Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically creating a File DSN
Message
 
To
28/06/2001 01:45:43
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00524501
Message ID:
00524567
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
Alternatively, if you're using ADO, you can create DSNless connections on the fly. Here's example of what I've been doing recently:
oConn=CreateObject("ADODB.Connection")
oConn.ConnectionString="Driver={Microsoft Visual FoxPro Driver};SourceDB=\\nbcserver\webdrive\testdata\webtest1.dbc;SourceType=DBC;"
oConn.Open

oRS=CreateObject("ADODB.RecordSet")
oRS.Open("Select * from webproducts", oConn)
Just need to change around the connection string for Access (even have them all stored in registry or INI. I'm currently planning to disconnect data from one of my apps to allow any data store to be used by VFP app.

>G'Day Andrew,
>
> Of course, how simple. It didn't occur to me that a .DSN file was just an .INI type file.
>
>Thanks Mate,
>Gavin...
>
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform