ODBC creation with SQLConfigDataSource
833130Jan 21 2011 — edited Feb 14 2011Hi everyone!
I use the function SQLConfigDataSource from the "odbccp32.dll" DLL to automatically create a data source from a Delphi application. I use it to create every kind of datasources (Firebird, SQL Server, Informis, Access, ...) And it works fine.
This Windows function returns "True" is the ODBC creation was successful and "False" if a problem occured.
I now try to create a connexion to an ORACLE database with the driver "Oracle in OraDB11hHome_home1" which is supplied by Oracle.
Here are the parameters I use :
SQLConfigDataSource (0, //Handle
ODBC_ADD_SYS_DSN, //Creation
'Oracle dans OraDB11gHome_home1', // ODBC driver
Pchar('DSN=MonDSN'+#0+
'ServerName=MonServerName'#0+
'UserID=MonUserId'+#0+
'Password=MonPassword'+#0+
'DisableMTS=F'+#0 +
'BatchAutocommitMode=IfAllSuccessful'+#0
+#0));
My problem is that the function returns "False" (Which would mean that a problem occured during the ODBC connexion). However, The ODBC is created and if I test the connexion to the database, it works just fine. Why does the function return "False" when the ODBC works great. Did I forget something in the configuration?.
Thank you for your answer.
NoƩmie