Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding an User DSN
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00713866
Message ID:
00713922
Views:
18
No, how can I use it?

>Have you use the SQLInstallerError API function to check the error occurred?
>
>
>
>>I´m running the following lines of code to create an User DSN programatically and it´s not working. When I delete the lines for UID and PWD the code creates the User DSN, but the UserID and password are wrong. Any tips?
>>
>>
>>DECLARE INTEGER SQLConfigDataSource IN ODBCCP32.DLL Integer, Short, String @, String @
>>
>>LOCAL	lcDriver, lcDSN, lnRC
>>
>>#define ODBC_ADD_DSN            1
>>#define ODBC_CONFIG_DSN         2
>>#define ODBC_REMOVE_DSN         3
>>#define ODBC_ADD_SYS_DSN        4
>>#define ODBC_CONFIG_SYS_DSN     5
>>#define ODBC_REMOVE_SYS_DSN     6
>>#define ODBC_REMOVE_DEFAULT_DSN 7
>>
>>lcDriver = "SQL Server" + CHR(0)
>>lcDSN    = "SERVER=EVALUATION\MIDDLETIERGED" + CHR(0) +;
>>		   "DESCRIPTION=XXXXXXXXXX"          + CHR(0) +;
>>		   "DSN=XXXXXXXXXX"                  + CHR(0) +;
>>		   "DATABASE=GDOCINTR"               + CHR(0) +;
>>		   "UID=sa"                          + CHR(0) +;
>>		   "PWD="                            + CHR(0)
>>
>>lnRC     = SQLConfigDataSource(0, ODBC_ADD_DSN, @lcDriver, @lcDSN)
>>
>>= MESSAGEBOX("lnRC = " + STR(lnRC, 2, 0))
>>
>>RETURN
>>
>>
>>Regards,
José Augusto Cavalcanti
Global Connection
jose.cavalcanti@globalconnection.com.br
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform