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
Title:
DSN-Less Connection using SQLGetInstalledDrivers, how ?
Miscellaneous
Thread ID:
00636806
Message ID:
00636806
Views:
38
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")
Luis Guzman, MCP
"The only glory most of us have to hope for
is the glory of being normal." Katherine Fulleton Gerould
Next
Reply
Map
View

Click here to load this message in the networking platform