Access and dbf

  • Thread starter Thread starter Armin
  • Start date Start date
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
 
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
 
Back
Top