Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DSN-Less Connection using SQLGetInstalledDrivers, how ?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00636806
Message ID:
00636812
Views:
23
There is a class with such functionality in the download section file #9749.
BTW, DSN-less connection is created using SQLSTRINGCONNECT( ) Function in the program w/o need to create any DSN's. You can consider using it.

>Hello Everybody!
>
>I trying to create a DSN on the fly using APIs but it is not working. Had anybody done that before, this is short version of the code:
>
>PROCEDURE ConfigureODBCConnection
>
>LOCAL lnRtnVal
>
> ODBC_ADD_DSN = 1
>
> lc_driver = "SQL Server" + CHR(0)
>
> lc_dsn = "DESCRIPTION= Luis DSN" + CHR(0)+;
> "DSN = TEST_SQL" + CHR(0)+;
> "DATABASE = MySQLDatabase " + CHR(0)+;
> "SERVER =MySQLServer" + CHR(0)+;
> "UID = sa " + CHR(0)+CHR(0)
>
>* Note: I also tried to use the IP address of the server and it did not work
>
> lnRtnVal = SQLConfigDataSource(0, odbc_add_dsn, @lc_Driver, @lc_dsn)
>
> IF TYPE("lnRtnVal") = "N" AND lnRtnVal = 1
> RETURN "SUCCESS!!!"
> ENDIF
>
> RETURN .F.
>
>
>
>Any suggestions ?
>
> =THIS.Thanks("in advance")
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform