其实ODBC配置是写在注册表中的,如果你认为安装盘运行的机器都带有ODBC,那可以用以下方法,
请参考,
Creating DSN is very easy in Installed shield. I am creating DSN in my setup.
Steps how to create DSN.
1. For your knowledge purpose, First create a sample DSN using ODBC.
2. Now click run and enter Regedit through Start Menu of the system.
3. and go to the HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBC.INI/
you will be seeing all DSN names with their respective folders (Ex: My DSN name is DefectTracker ).
4.If you click on your sample DSN Name folder (ExefectTracker), you will be seeing Name,type and Data on right side of the screen.
Under Name -- Data
Database -- DefectTracker
Driver -- C:/WINNT/System32/sqlsrv32.dll
LastUser -- sa
5. and go to the path HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBC.INI/ODBC Data Sources. Here in right side of the screen,u can see your sample database name.
6. Now, what u have todo
is....
7.create the same path in installedshield at Resource tab under Registry Set.
8. And generally Server name will be different, so u need to write the syntax to create Server name in the specified folder in Registry.By using
szKey = "SOFTWARE//ODBC//ODBC.INI//DefectTracker";
szServerSet = "SERVER";
nType = REGDB_STRING;
nSize = -1;
if (RegDBSetKeyValueEx (szKey, szServerSet, nType,szServer,nSize) < 0) then
MessageBox ("Not able to Create DSN for DefectTracker.", SEVERE);
endif;
u need to pass the Server servername in to szserver variable.
Your DSN will be created.
If anydo
ubts pls feel free to ask again...
Thanks