Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a user DSN
Message
 
To
28/10/2001 21:00:45
Fausto Garcia
Independent Developer
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00532392
Message ID:
00574343
Views:
26
Hi,
#define ODBC_ADD_DSN        1
#define ODBC_CONFIG_DSN     2
#define ODBC_REMOVE_DSN     3
#define ODBC_ADD_SYS_DSN    4	&& add a system DSN
#define ODBC_CONFIG_SYS_DSN 5	&& Configure a system DSN
#define ODBC_REMOVE_SYS_DSN 6	&& remove a system DSN

Declare Long SQLConfigDataSource In ODBCCP32.DLL ;
Long hwndParent, Long fRequest, String lpszDriver, String lpszAttributes

strDriver = "Microsoft Visual FoxPro Driver"
strAttributes = "DESCRIPTION=Temp DSN" + Chr(0)
strAttributes = strAttributes + "DSN=DSN_TEMP" + Chr(0)
strAttributes = strAttributes + "Deleted=Yes" + Chr(0)
strAttributes = strAttributes + "Null=Yes" + Chr(0)
strAttributes = strAttributes + "Collate=Machine" + Chr(0)
strAttributes = strAttributes + "BackgroundFetch=Yes" + Chr(0)
strAttributes = strAttributes + "Exclusive=No" + Chr(0)
strAttributes = strAttributes + "SourceType=DBF" + Chr(0)
strAttributes = strAttributes + "SourceDB=e:\" + Chr(0)
intRet = SQLConfigDataSource(0, <B>ODBC_ADD_SYS_DSN</B>, @strDriver, @strAttributes)
If intRet = 0
   MessageBox("DSN Create Failed")
EndIf
>Hi Alexander,
>Several weeks ago you posted some code to create a user DSN that points to the VFP ODBC driver programatically. Could you please tell me how can I modify it in order to get a SYSTEM DSN created instead of a user DSN?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform