jack niekerk
asked on
How to open (read only will do) a Foxpro database in VB6
I did install ODBC from Microsoft for Foxpro, I need to reed information from sales tables/datafiles created in Foxpro from within VB6 pro
How to setup connection and just plain read from record 1 to record xxxxx
How to setup connection and just plain read from record 1 to record xxxxx
good morning!
try something like this...
Dim cn as adodb.connection
Dim rs as adodb.recordset
set cn = new adodb.connection
set rs = new adodb.recordset
cn.open "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;Sou
rs.open "Select * from YOURTABLE",cn,adOpenKeyset
i hope give u some idea...
game-master
ASKER
I did create in ODBC a connection to one dbf file using this
Cn.Open "Driver= Microsoft Visual FoxPro Driver;SourceType=DBF;Sour ceDb=J:\RU NDER\FOXPR O\;Exclusi ve=No"
or this
Cn.Open "Provider=Microsoft Visual FoxPro Driver;Data Source=J:\RUNDER\FOXPRO\;C ollecting Sequence=general;
will give both ways a run error 3706,
Cn.Open "Driver= Microsoft Visual FoxPro Driver;SourceType=DBF;Sour
or this
Cn.Open "Provider=Microsoft Visual FoxPro Driver;Data Source=J:\RUNDER\FOXPRO\;C
will give both ways a run error 3706,
What is the text of the error message, please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok tusharkanvinde
RST.Open "Select * from J:\RUNDER\FOXPRO\afilart", Cn, adOpenKeyset, adLockOptimistic will work
but even when I did give in the open statement the "data source = J:\RUNDER\FOXPRO\;
"Select * from afilart will say file not found and "Select * from J:\RUNDER\FOXPRO\afilart will do.
But I can live that if not to solve
RST.Open "Select * from J:\RUNDER\FOXPRO\afilart",
but even when I did give in the open statement the "data source = J:\RUNDER\FOXPRO\;
"Select * from afilart will say file not found and "Select * from J:\RUNDER\FOXPRO\afilart will do.
But I can live that if not to solve
ASKER
and offcourse I did download VFP oledb drive
ASKER
the "'' use the VFP OLEDB driver instead of the ODBC driver. Data created in VFP7 and later may not be readable by the ODBC """
solved the problem to connect
solved the problem to connect
Are you saying that you had to use the vfpoledb driver that I suggested in the first comment?
ASKER
I did not now about the existance off this needed link:
http://www.microsoft.com/downloads/details.aspx?familyid=E1A87D8F-2D58-491F-A0FA-95A3289C5FD4&displaylang=en
I wrote back after firts comment i used the default ODBC, and that did not work. (off course my error due to the unkown above to me)
When tusharkanvinde teached me this link my program worked
http://www.microsoft.com/downloads/details.aspx?familyid=E1A87D8F-2D58-491F-A0FA-95A3289C5FD4&displaylang=en
I wrote back after firts comment i used the default ODBC, and that did not work. (off course my error due to the unkown above to me)
When tusharkanvinde teached me this link my program worked
Cn.Open "Driver= Microsoft Visual FoxPro Driver;SourceType=DBF;Sour
u forgot the {} on the "Microsoft Visual FoxPro Driver"
that should work because im using those connection..
game-master
Open in new window