I've never worked with DBs in Deplhi before so I'm kind of lost. Is there a way to connect to a Access 97 DB without using a DSN? A little example perhaps?
Hmm... Thanks , but unfortunately that doesn't solve my problem.
In the end, what I need to do is some way to connect to access DB without having to set anything outside my program. I'm writing a CGI program that will reside in a NT server that I don't admin, so I need to connect to the DB without setting DSN or BDE aliases.Of course this can be done in Delphi, but I don't know if theres a simple way to do it.
Anyway, in the meanwhile I arrived to a simple and ugly solution: From my program, I call some ASP scripts to do my DB work, while I do whith delphi what I can't do with ASP.
Hi Ashkar,
All u want to do can be done using Session Variable or using Session Component from "Data Access" Page, which is available whenever you user DBTables unit in your unit uses clause.
below is simple piece of code which can be used to first check if BDE alias exists, if not then create new BDE alias
for Access DataBase.
//Code
if not Session.IsAlias('MyAlias') then
begin
try
DriverList := TStringList.Create;
DriverList.Add('DATABASE NAME= DRIVE:/PATH/DATABASE.MDB');
DriverList.Add('USER NAME = UserName');
Session.AddAlias('MyAlias','MSACCESS',DriverList);
finally
DriverList.Free;
end;
end;
and define DriverList as
var
DriverList : TStrings;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.