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

Opening a dbase file with ODBC

Status
Not open for further replies.

dlpastel

Programmer
Aug 8, 2002
114
US
I am trying to open a Clipper dbase III file and get the error:
[Microsoft] [ODBC dBase driver] Index file not found
I do not use any ndx indexes with the dbf. I do use nsx indexes but I do not need to open any indexes for what I want to do.
How do I get around the error?
Below is my code

Private Sub cmdExport_Click()
Dim StrSql As String
Dim dbRts As Connection
Dim RsRts As ADODB.Recordset
On Error GoTo ProcErr
StrSql = "Select JOBNUM,ADDR,ZIP from Job " & _
"WHERE EMPTY(MAPCODE) = TRUE "
Set dbRts = New Connection
dbRts.CursorLocation = adUseServer
dbRts.Open "PROVIDER=MSDASQL;dsn=DBase3;uid=;pwd=;database=C:\RTS\Data\JOB.dbf"

Set RsRts = New ADODB.Recordset
RsRts.Open StrSql, dbRts
Debug.Print RsRts.recordcount
Exit Sub
ProcErr:
Debug.Print Err.Description, Erl
End Sub

Thanks,
Dan
 
Yes, but I cannot open it as a link in Access. I get the same error. Other dbase files I have seem to open fine
 
Figured it out. I had a old Job.inf file located in the directory which was specifying the incorrect indexes.

Thanks, Dan
 
Aha. Didn't look like there was anything wrong with your ADO code.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top