Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get 2 dbf files to form a simple recordset in ADO
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00664349
Message ID:
00665106
Vues:
25
And if the two dbfs have the same table structure (which would need to be the case for the UNION to work) you could actually loop through the second and add rows to the first, right? It would require some code, and would not be anywhere near as quick as a union, but....

>Can't you have both DBF into the same folder (maybe you can copy one temporarily). This way you could use:
>
>
oConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};" & _
>           "DriverID=277;" & _
>           "Dbq=c:\somepath;"
>SELECT Col1, Col2, Col3
>FROM Table1.dbf
>UNION
>SELECT Col1, Col2, Col3
>FROM Table2.dbf
>
>
>>Hi,
>>
>>Thank for your help but my dbf is located in different location,
>>so my ODBC location is actually pointing to different location,
>>will doing the following still work
>>
>>rs = cnn.Open .....
>>
>>
>>>You can surely do this using the UNION operator:
>>>
SELECT Col1, Col2, Col3
>>>FROM Table1
>>>WHERE Col1 = Criteria
>>>UNION
>>>SELECT Col1, Col2, Col3
>>>FROM Table2
>>>WHERE Col1 = Criteria
>>>ORDER BY Col1, Col2
>>>
>>>
>>>>Hi,
>>>>
>>>>Using VB6, is there any way to do a SQL or retrieve data
>>>>from two dbf file from different location using ADO to
>>>>form a single recordset which I intend it for use with
>>>>Crystal Report 8.5.
>>>>
>>>>I had tried to use CR query designer, but it can't
>>>>using ODBC Visual Foxpro driver.
>>>>
>>>>Is there any recommend way or refer way to do similar stuff
>>>>as I want only my Crystal report (.rpt) to pull the
>>>>required record automatically, without having to have individual
>>>>form for each report.
>>>>
>>>>Please kindly advise.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform