Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically creating a File DSN
Message
 
À
28/06/2001 01:45:43
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00524501
Message ID:
00524567
Vues:
26
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform