Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Access databases
Message
 
À
22/03/1999 09:27:25
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00200430
Message ID:
00200465
Vues:
10
Hi Sergio,

This should get you on the right track:

Barry,

Not sure that I have figured it out myself, but here is in a nutshell what I have done:

1. I have installed ODBC, or rather I had ODBC installed. I think you do do that via the setup of Visual FoxPro.
2. Via Window98 Start/Settings/ControlPanel/Odbc I established what is known as a DSN, a datasource name.
3. I have manage to create a user and a system DSN. I'd love to have a file DSN, but have not been able to do that up till now. I like the id, because via this FDSN, you get a source file that you could change programmatically.
4. I'm not sure what the difference is between user and system, but guess this difference becomes apparent if you have user profiles installed on your station which is not my case.
5. To create a DSN you
5a. press the Add... button.
5b. you select one of the drivers, hopefully you have the Access driver installed otherwise your back to square (read point) 1.
5c. then you name your DSN, and you Select ... (read go and fetch the .mdb file)
To the best of my knowlege you need to map a network drive in order to acces it.
6. Apply or Ok this window, now you should see your dsn together with other dsn's in the user data source list.
7. You now are done with odbc for now ...
8. Open Visual FoxPro
9. execute the following: n= sqlconnect(). The system answers with the list you just saw under odbc. Choose your dsn. Examine n, if it is positive, you are in business.
10. try an sqlexecute, see in help how to do that, but be advised that n is your connection handle.

The connection you've established is the level 0 of the connections. The xxsetprop functions allow you to adapt the connection to your needs, if you understand what you are doing, which ... is not my case, so I use the default.

Be advised also that your sql's have to pass through 2 compilers (read pains in the butt), ODBC with its limitations and Access with its, that is if you choose sql passthrough access.

Remote views are possible too (an alternate way of doing exactly the same), but you need a .dbc. You can then save the connection in the .dbc, using the ODBC dsn you've create and see from there.

In general, I would advise to read the programmer's guide, because to my own surprise it is very interesting reading.

I've only scratched the surface of the subject here, but it should be enough to
let you start. Get back to me if you think I can be of any help. I may even be able to clarify some things that I was not able to formulate properly.

Kind regards,

Marc





>Hello everyone,
>Does anybody have an idea on how to use an Access databases from VFP.?
>
>Is there any example that I can look at.
>
>Thanks in advance.
>Sergio

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform