Im trying to read a dbase file using the following code:
When I try to read the database I get the error: "Unable to locate the requested xbase memo file." Can anyone please help me with this?? And yes, the dbf file does reside in the C:\Temp folder. Ive also tried changing the string to include brackets and not include brackets. Ive been looking all over the place for some working code to access a dbf file using vb.net.
Code:
Dim dbstr as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp;Extended Properties=dBase III"
Try
myConn = New OleDbConnection(dbstr)
myCmd = New OleDbCommand("Select [DB1Last] From [ACC.DBF]", myConn)
myConn.Open()
myReader = myCmd.ExecuteReader() <-- error occurs here
MsgBox(CStr(myReader(0)))
myReader.Close()
Finally
myConn.Close()
End Try
When I try to read the database I get the error: "Unable to locate the requested xbase memo file." Can anyone please help me with this?? And yes, the dbf file does reside in the C:\Temp folder. Ive also tried changing the string to include brackets and not include brackets. Ive been looking all over the place for some working code to access a dbf file using vb.net.