Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File DSN
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00404758
Message ID:
00404824
Views:
14
>Mark -
>
>Not having used a file DSN, I don't know the "right" way to do this ... however, if you can't determine the "right" way, you can read the file using your favorite text-parsing tool (such as ALINES) and then use the API call SQLConfigDataSource (documented in the UT API section) to create a User DSN which is a clone of the File DSN.
>
>The main drawback of this approach (besides that it's a kludge!) is that I can't tell you how to delete the User DSN you created. However, I imagine there is an API call for that too.
>

It's the same API call - you just call SQLConfigDataSource() a second time when you're done, using the constant ODBC_REMOVE_DSN instead of ODBC_ADD_DSN

It's not a kludge at all; it's the same function used by the ODBC Administrator applet to do the same things. You can create and destroy System DSNs with the same API call, just change the ODBC_ADD_DSN to ODBC_ADD_SYS_DSN and ODBC_REMOVE_DSN to ODBC_REMOVE_SYS_DSN

>If you find a better way, let me know; if not, let me know how this worked for you!


>>How do you connect to a file data source using SPT?
>>
>>SQLConnect('xyz') works fine with User and/or System DSN but not File DSN.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform