Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO Question?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00214760
Message ID:
00214769
Vues:
18
>I have several free tables in 2 different directories. I want to create a recordset with a select statement that pulls data from all three tables. My question is: How do I do this with 2 different connections?
>Here is some psuedo code of what I want to do(Sorry for the VB syntax):
>
>Table1 is in \\Netserv3\Salessys\Sales directory
>Table2 is in \\Netserv3\Salessys\Sales directory
>Table3 is in \\Netserv3\Salessys\Sales\Data directory
>Table4 is empty Recordset Object
>
>oConn1 is connection to \\Netserv3\Salessys\Sales directory
>oConn2 is Connection to \\Netserv3\Salessys\Sales\Data directory
>
>oRs_Table1.Open "Table1", oConn1, adOpenStatic, adLockReadOnly, adCmdTable
>
>oRs_Table2.Open "Table2", oConn1, adOpenStatic, adLockReadOnly, adcmdTable
>
>oRs_Table3.Open "Table3", oConn2, adOpenStatic, adLockReadonly, adcmdTable
>
>SqlString = "Select oRs_Table1('Cusno'), oRs_Table2('Addr1'), oRs_Table2('City'), oRs_Table2('State'), oRs_Table2('Zip'), oRs_Table3('TSales') Where oRs_Table1('Cusno') = oRs_Table2('Cusno') And oRs_Table2('Cusno') = oRs_Table3('Cusno') Order By Table1('Cusno')"
>
>oRs_Table4.Open SqlString
>
>Everytime I try to open oRs_Table4 with the sqlstring, I get an error stating I need to specify a valid connection. How do I do this without having to have all of the tables in one directory?

Tim,

First, create two DSN's one pointing to the DBC in each folder. Or if the tables are free tables, create one pointing to each folder. This will give you access to the tables in each DBC and/or folder. As long as you leave the connection open, you can create multiple recordsets against each one.

If there's anything else I can do to help, don't hesitate to contact me directly, it will get you a faster response than posting here will.

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform