dBase Connection

  • Thread starter Thread starter Kshitij Rajhans
  • Start date Start date
K

Kshitij Rajhans

HI,

How to connect to the dBase database?? One option is to create a DSN and
use it.But I want to do it in some other way like just passing a
connection string or like that.

Thanks in advance.
 
HI,

How to connect to the dBase database?? One option is to create a DSN and
use it.But I want to do it in some other way like just passing a
connection string or like that.
Have a look at "ADO Connection Strings" By Carlos Antollini
http://www.codeproject.com/database/connectionstrings.asp

BTW, DON'T CLICK ON THE SHORTCUTS, they are pointing to the wrong page.
Just browse the page!


The way I usually do it is to create an UDL file, just create a textfile
and rename it so it has the extension .UDL
Then double-click on it. You will now get a "wizard" for creating a
connection string.

I select 'Microsoft Jet 4.0 OLE DB' as the provider.
Then you need to edit Extended Properties under the All tab
it should have the value: dBase 5.0
NB! Microsoft does NOT support dBase database formats above 5.0!!!

The big advantage of the UDL file is that you can change everything without
touching the program!

To open the database just enter the path to the udl file.

NB! This is ADO in C++ and not for ADO.NET, but I think you get the
picture...
CString udl
udl = "c:\\dummy.udl"; // here you read the registry or something
m_pConn->Open(_bstr_t(udl),
_bstr_t ( "" ),
_bstr_t ( "" ),
adModeUnknown );



// Anders
 
Back
Top