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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to FP 2.6 DBF in Vb

Status
Not open for further replies.

Salmano

Programmer
Oct 4, 2001
34
RO
Hello !
I have the code:

Dim db As Database
Dim rs As Recordset
Dim sql As String
sql = "Select clasa, denumirea from ram"
Set db = OpenDatabase("D:\SALV\NOMEN\", dbDriverPrompt, True, "FoxPro 2.6; DATABASE=D:\SALV\NOMEN\RAM.DBF")
Set rs = db.OpenRecordset(sql, dbOpenDynaset, dbReadOnly + dbOptimistic)

Using this I want to connect to a DBF table created in FoxPro 2.6, but vb says: type mismatch on OpenRecordset line. I have references to MS DAO 2.5/3.51

Thanks in advance.
Salmano
 
I'd specify either the dbReadonly or the dbOptimistic argument but not both. Why would you want to lock the page containing the record in case of a update if the recordset is readonly?

Herman :-Q
 
Thank you Herman. You have your point, but the error remains even if I use one of dbReadOnly, dbOptimistic... I'll try other ways... If you have other ideas, please write. Thanks again.
Salmano.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top