Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SQLConfigDataSource
Message
From
07/02/2000 08:23:02
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Problem with SQLConfigDataSource
Miscellaneous
Thread ID:
00328194
Message ID:
00328194
Views:
61
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
Map
View

Click here to load this message in the networking platform