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

dBase + VB2008

Status
Not open for further replies.

heavymetalharry

Programmer
Feb 4, 2011
1
IE
I am trying to a Dbase file with a .CDB extension using MS VB2008.
If I change the extension to .DBF everything works fine. I must retain the .CDB extension.
The connection string I am using is:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;Password=;.

I am told the "Microsoft.Jet" engine will only recognise .DBF

Is there any other connection string I could use ?
 
Have you tried using ADO, creating a ConnectionString and RecordSet? Although it's a pain and a bit awkward, it does work once you figure it all out. Here's how it is done in Visual FoxPro (requires installed Microsoft Office2007 OLE ODBC Access Database Engine):
Code:
oConn = CREATEOBJECT("ADODB.Connection")
* set this property:
oConn.Mode
oConn.Open("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq="+myPath)
oRSet = CREATEOBJECT("ADODB.Recordset")
oRSet.Open("SELECT * FROM "+myTable,oConn)
* set these properties:
oRSet.CursorLocation
oRSet.CursorType
oRSet.LockType
Be sure to lookup the various property settings on some tutorial sites such as
ADO drivers do have limits and not all ADO features are coded in every driver, for example, Sort does not workin this driver.

Warning from past experience: If appending a record, any dates in those appended records that are referenced in indexes must have non-empty values or the index *always* gets corrupted and has to be reindexed or recreated from within dBase. Evidently the driver does not know how to handle null dates when manipulating the index.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top