PDA

View Full Version : ODBC data sources??



NewsArchive
03-08-2000, 01:00 AM
Use the ODBC object. It can install a Driver and a DSN for some database
programs using its wizard, or you can use the two methods available through
the object to install them through your script.

--
Mike Gillow
CBORD

Nicolas Prévost <nprevost@aquadata.com> wrote in message
news:38c6bec7.0@news.installshield.com...
> Hi, I was wondering how could I create a User Data Source using install
> shield 6.0. I included Jet 4.0 Installshield object because my program
need
> it but I need also to create a user dsn to allow my program to get the
right
> database.
> Thanks a lot.
> Nick.
>
>

NewsArchive
09-06-2000, 12:00 AM
Change your date-------------

"Nicolas Prévost" <nprevost@aquadata.com> wrote in message
news:38c6bec7.0@news.installshield.com...
> Hi, I was wondering how could I create a User Data Source using install
> shield 6.0. I included Jet 4.0 Installshield object because my program
need
> it but I need also to create a user dsn to allow my program to get the
right
> database.
> Thanks a lot.
> Nick.
>
>

NewsArchive
02-07-2001, 01:00 AM
You can also do it programmitically with the Registry funtions in install
script.

I say this way b/c of paste experience, I do not trust IS objects nor merge
modules that were written by Installshield..

Go to you ODBC administrator and create a new DNS as you would like the
install to make for you , only give it a very unique name, like
"ummmagumma".. Then search the registry for "ummagumma'..

Then just create that registry setting with the IS functions..

I have done just that a year or so ago and it worked fine... I just can't
remember off hand where the settings are..

good luck


"Nicolas Prévost" <nprevost@aquadata.com> wrote in message
news:38c6bec7.0@news.installshield.com...
> Hi, I was wondering how could I create a User Data Source using install
> shield 6.0. I included Jet 4.0 Installshield object because my program
need
> it but I need also to create a user dsn to allow my program to get the
right
> database.
> Thanks a lot.
> Nick.
>
>

NewsArchive
12-01-2001, 01:00 AM
Hi, I was wondering how could I create a User Data Source using install
shield 6.0. I included Jet 4.0 Installshield object because my program need
it but I need also to create a user dsn to allow my program to get the right
database.
Thanks a lot.
Nick.

rajroshan
12-08-2001, 01:20 AM
hi,
you can do it like writing the script in your .rul file . You have to write some registry info into your reg edit . here is code .
set Object = GetObject("New ODBC 3.51 1");

//set the parameters for the InstallDataSource function

szAttribs= "Driver=\\sqlsrv32.dll\n" +"DriverName=SQL Server\n";
szDSNType = "system"; //The DSN type can be either "user" or "system"
szName = "MYDSN"; //The DSN name you want displayed in the ODBC Administrator
bUninstall = TRUE; //setting this parameter to TRUE will uninstall the DSN when the component with the ODBC Object is uninstalled setting the parameter to FALSE will not uninstall the DSN
if ( Object.InstallDataSource ( szAttribs, szDSNType, szName, bUninstall ) <0) then
MessageBox("The DSN didn't install correctly",0);
abort;
else
SdShowMsg("The DSN successfully installed",TRUE);
Delay(3);
//MessageBox("The DSN successfully installed",0);
endif;

szKey="SOFTWARE\\ODBC\\ODBC.INI\\MYDSN";
szKey1="SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources";
szClass="";

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
created=RegDBCreateKeyEx(szKey,szClass);
RegDBSetKeyValueEx(szKey,"(Default)",REGDB_STRING,"",-1);
setr=RegDBSetKeyValueEx(szKey,"DRIVER",REGDB_STRING,"C:\\winnt\\System\\SQLSRV32.dl-1);
RegDBSetKeyValueEx(szKey,"DESCRIPTION",REGDB_STRING,"for MYDSN Program",-1);
RegDBSetKeyValueEx(szKey,"LASTUSER",REGDB_STRING,"MYDSN",-1);
RegDBSetKeyValueEx(szKey,"Password",REGDB_STRING,"MYDSN",-1);
RegDBSetKeyValueEx(szKey,"SERVER",REGDB_STRING,"(local)",-1);

set1=RegDBSetKeyValueEx(szKey1,MYDSN,REGDB_STRING,"SQL Server",-1);

i think , this will solve your problem .
best of luck
raj