General information
Category:
Windows API functions
Title:
Problem with SQLConfigDataSource
Hi !
I try to create a User Data Source to access SQL Server.
I use the API 'SQLConfigDataSource' to create it.
Here is my code :
DECLARE integer SQLConfigDataSource in odbccp32.dll Integer, Integer, String, String
local lcSettings
lcSettings = 'DSN=MyDSN'
= SQLConfigDataSource(0,3,'SQL Server',lcSettings) && Delete DSN
lcSettings = 'DSN=MyDSN' + CHR(0) + 'Description=MyDesc' + CHR(0) + 'Server=MySQLServer' + CHR(0) + 'DATABASE=MyDatabase' + CHR(0) + 'OEMTOANSI=NO' && Recreate the DSN
Sometimes it crash in '.prg' mode but it always crash in '.exe' mode when the user have MDAC 2.1 on is PC. (the code crash when it try to recreate the DSN).
Did someone know why ?
Thanks in advance !
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only