Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File DSN in Cursoradapter Builder
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00985862
Message ID:
00985954
Vues:
34
>I'd built a File DSN (based on a MySQL ODBC driver) I'd like to use as the data source in some Cursoradapter classes, and the connection tests OK. However, I can only get the Properties tab of the Cursoradapter builder to give me a choice of my development machine's User DSNs and System DSNs. Perhaps it has something to with the .dsn file's location (putting it in a folder in my VFP path doesn't help), or perhaps the builder just wasn't designed to include File DSNs in its choices. Can anyone assist? Thanks.

The DataSource needs to evaluate to a connection handle. AFAIK, it can not take the path + name of a file DSN as it will not process/evaluate that. You should use a class, connection object to manage your connections. Then for the CA DataSource, I set its value to =GetHandle(). I have GetHandle in a general application procedure file (SET PROCEDURE TO MyProcs). This GetHandle procedure will call the appropriate method in my connection class that returns the connection handle back to my CA classes.

I use a classlib of CAs which is generated by my CABuilder which you can get for free along with source code by clicking the FoxPro Tools link at http://www.mctweedle.com. The builder first create a CABase class from which all the other CAs for each table in my DBC, Oracle or SQL Server database is subclassed. I then only have to set the DataSource property in my CABase class.

My CABuilder class for VFP9 is now mostly data driven, so you can extend it to work with MySQL.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform