你可以设置一个动态的数据库别名,以下方法可以实现,假设你用的是desktop的pardox数据库
with session do
begin
configmode:=cmsession;
try
addstandardalias('别名',extractfilepath(paramstr(0)),'PARADOX');
finally
configmod:=cmall;
end;
(欢迎光临碧草青青http://rongercao.go.163.com)
with session do
begin
configmode:=cmsession;
try
addstandardalias('别名',extractfilepath(paramstr(0)),'PARADOX');
finally
configmod:=cmall;
end;
(欢迎光临碧草青青http://rongercao.go.163.com)
如果是Access你可以动态配置数据源:(察看这篇文章)
http://renzhm.home.sohu.com/programme/delphi/d0020.htm
草哥,不行啊!我用了你的方法,最后连数据库也打不开了,怎么回事???
哈哈.................我虽然菜,但这个我还是知道。
哈哈.................我虽然菜,但这个我还是知道。