Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a user DSN
Message
 
To
19/07/2001 09:09:26
Fausto Garcia
Independent Developer
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00532392
Message ID:
00532486
Views:
37
This message has been marked as a message which has helped to the initial question of the thread.
>How would the code look if I need to use the VFP ODBC driver for free tables? Could you please post a specific chunk of code?

Certainly!
#define ODBC_ADD_DSN 1
#define ODBC_CONFIG_DSN 2
#define ODBC_REMOVE_DSN 3

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=c:\your_path_here" + Chr(0)
intRet = SQLConfigDataSource(0, ODBC_ADD_DSN, @strDriver, @strAttributes)
If intRet = 0
   MessageBox("DSN Create Failed")
EndIf
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform