pl456
Registered User.
- Local time
- Today, 07:35
- Joined
- Jan 31, 2008
- Messages
- 150
OK, I am not the best when it comes to code. I have been struggling with ODBC connections for FoxPro databases and have been forced down the route of OLEDB drivers instead.
I think I have connected with the database (the code runs) but how do I retrieve the data I want?
The only way I know is to have linked tables in order to be able set a query up and pass an sql string to it, but the only way I can link the tables is by ODBC.
This is the OLEDB connection code to link (which I found on another site), I was planning on putting an select statement in but how without working on the linked tables.
Dim objCon As ADODB.Connection
Dim objCom As ADODB.Command
Set objCon = New ADODB.Connection
Set objCom = New ADODB.Command
objCon.ConnectionString = "Provider=VFPOLEDB.1;Data Source=H:\myfoxprodatabase.dbc;Collating Sequence=MACHINE"
objCon.Open objCon.ConnectionString
I think I have connected with the database (the code runs) but how do I retrieve the data I want?
The only way I know is to have linked tables in order to be able set a query up and pass an sql string to it, but the only way I can link the tables is by ODBC.
This is the OLEDB connection code to link (which I found on another site), I was planning on putting an select statement in but how without working on the linked tables.
Dim objCon As ADODB.Connection
Dim objCom As ADODB.Command
Set objCon = New ADODB.Connection
Set objCom = New ADODB.Command
objCon.ConnectionString = "Provider=VFPOLEDB.1;Data Source=H:\myfoxprodatabase.dbc;Collating Sequence=MACHINE"
objCon.Open objCon.ConnectionString