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