Access and dbf

A

Armin

I've been trying to access a dbf using this code :

dim db as DAO.Database, rcd as DAO.Recordset, strCaseId as
string

strCaseId = me!CaseNum


Set db = DBEngine.Workspaces(0).OpenDatabase
("C:\dBase\dbf\", False, False, "dBASE 5.0;")

'I don't want to open all records so I've
replaced "general1" with the SQL code.

Set rcd = db.OpenRecordset(" SELECT * FROM " & _
"General1 WHERE [Case_num] =" & strCaseId)

I always get "No Current Record" even if I replace
strCaseId with a number like 09009.the record exists in
the dbf.

Thanks in advance

Armin
 
L

Larry Linson

Is there some reason not to use File | Get External Data | Link to link the
DBF? That is the normal, and easy, way to accomplish reading an external DBF
file in an Access MDB.

Larry Linson
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top