Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

...I enjoy spending time on it for personal growth (I learn from the questions I don't answer, and I reinforce/stay sharp on the topics I do answer), and to give back to humanity at large...

Geography

Where in the world do Tek-Tips members come from?
heavymetalharry (Programmer)
4 Feb 11 4:33
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 ?
dbMark (Programmer)
8 Feb 11 12:11
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 http://www.w3schools.com/ado/default.asp

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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close