Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query FoxPro via ODBC & VB

Status
Not open for further replies.

Varco

Programmer
Oct 22, 2000
49
US
I am trying to retrieve data from multiple tables in a FoXPro DB, using ODBC and VB. The tables may be joined using either an equal or left join, and may have several of each type of join. I have queries that work fine for any number of equal joins, or a single left join. Where I run into trouble is if there are several equal joins and one or more left joins. Queries that I know work on other DB's don't here. Can anyone offer suggestions, or point me to a resource so I can sort this out? I have been trying to do this using subqueries, and the FoxPro ODBC driver apparently doesn't like this.

Regards,

Jim Varco
Varco Consulting
 
Well, I don't know if you would be interested in using OLEDB/RDO to query FoxPro tables.

I used to use RDO to connect & query FoxPro tables.

References: MS RDO 2.0
Dim SQL As String
Dim cn As New rdoConnection
Dim rs As rdoResultset

cn.Connect = "SourceType=DBF;" _
& "SourceDB=C:\Rob;" _
& "Driver={Microsoft Visual FoxPro Driver}"

cn.CursorDriver = rdUseOdbc
cn.EstablishConnection "rdDriverNoPrompt"

SQL = "SELECT * FROM TableName" 'should be a free table

Set rs = cn.OpenResultset(SQL, rdOpenKeyset, rdConcurRowVer)

 
I am not sure if the above piece of code is ODBC or OLEDB.
What's the difference? I taugh VB myself so I am not good in understanding those terms...Someone please educate me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top