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

How to access and Access db from delphi 5 std

Status
Not open for further replies.

TheSaviour

Programmer
Sep 14, 2002
13
0
0
GB
Can someone please show me how to access and access db from Delphi 5 std, I would like to show the results in a memo
 
You have to use the BDE administrator first to create an alias linked to the Access database. Use msaccess driver to make the connection.
In Delphi your TTable or TQuery must be pointing to the alias. S. van Els
SAvanEls@cq-link.sr
 
Delphi 5 standard don't have the BDE administrator
 
Impossible, or it is incomplete illegal copy, The standard edition doesn't have the SQL explorer or the Database explorer with the sql drivers. The BDE administrator can be localized in the control panel. S. van Els
SAvanEls@cq-link.sr
 
We have the enterprise edition, but we code the alias in. I think this will work in standard. You'll need to add an ODBC connection, either through the control panel (ODBC Administrator) or through some install tool. This is the code we use for an ODBC connection to Access.

LSTRS_Parameters := TStringList.Create;
If Session.IsAlias('Cars_AIS_Maindb') then
Session.DeleteAlias('Cars_AIS_Maindb');
LSTRS_Parameters.Add('DATABASE NAME=H:\data\046\chicago\carsdb\Main.mdb');
LSTRS_Parameters.Add('ODBC DSN=Cars_Ais_Maindb');
Session.AddAlias('Cars_AIS_Maindb', 'Microsoft Access Driver (*.mdb)', LSTRS_Parameters);
LSTRS_Parameters.free;
}
 
I'll try to finish my previous post! :-/

KaDao are free and work very well. They save you the need to use BDE but do mean that you are depending on Microsoft DAO and the Jet engine to access the files. I'll do most anything not to use BDE ;-) The newest version (7.2) seems to be particularly robust. The main problem I've come across using these is when using DataModules but that is documented in "Known Bugs and Problems" on the web page.

BTW these components will open anything DAO will ie .dbf .xls ODBC etc.

Try them see what you think

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top