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

database path from app folder.

Status
Not open for further replies.

wiredX

Programmer
Mar 22, 2004
6
NG
Hello all,

Am working on a db project and I was wondering how I can write with my code to pick the db path from the app path. Am using adoconnection with adoquery. I do be greatful if anyone can show me a code snipet.

wiredX
 
I Have solved the problem.

For any newbie, here is what I did,

var
DbPath : String;


begin

//adotable1.Connection := adoconnection1;

DbPath := ExtractFilePath(Application.ExeName) + ExtractfileName('QuickiesContest.mdb');

adoconnection1.ConnectionString :=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + DbPath ;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top