应用程序通过bde别名‘myalias’连接到数据库,那么在其他机器上非得建立这个别名并且数据库文件放在该别名指定的目录下?
是的话,如果别人的机器上没有BDE Administrator,那又该怎么配置呢。比如安装一Paradox数据库应用系统(只用了tquery组件)需
Idapi32.dll、Blw32.dll、Idr20009.dll、Fareast.btl、Usa.btl、Idpdx32.dll,Idsql32.dll,
HKEY_LOCAL_MACHINE\Software\Borland\Database Engine\DLLPATH=[installdir]
HKEY_LOCAL_MACHINE\Software \Borland\BLW32\BLAPIPATH=[installdir]
HKEY_LOCAL_MACHINE\Software\Borland\BLW32\LOCALE_LIB0="fareasst.btl" HKEY_LOCAL_MACHINE\Software\Borland \BLW32\LOCALE_LIB1="usa.btl"
还缺少什么?
是的话,如果别人的机器上没有BDE Administrator,那又该怎么配置呢。比如安装一Paradox数据库应用系统(只用了tquery组件)需
Idapi32.dll、Blw32.dll、Idr20009.dll、Fareast.btl、Usa.btl、Idpdx32.dll,Idsql32.dll,
HKEY_LOCAL_MACHINE\Software\Borland\Database Engine\DLLPATH=[installdir]
HKEY_LOCAL_MACHINE\Software \Borland\BLW32\BLAPIPATH=[installdir]
HKEY_LOCAL_MACHINE\Software\Borland\BLW32\LOCALE_LIB0="fareasst.btl" HKEY_LOCAL_MACHINE\Software\Borland \BLW32\LOCALE_LIB1="usa.btl"
还缺少什么?
//var
// Str : E
begin
if SaveDialog1.Execute then
begin
Session1.GetAliasNames(ComboBox1.Items);
if ComboBox1.Items.IndexOf(Edit1.Text )<> -1 then
begin
Application.MessageBox('对不起,您建立的这个别名已经存在,请您重新选择','提示',mb_ok+mb_IconInformation);
Exit;
end;
Session1.AddStandardAlias(Edit1.Text ,ExtractFilePath(SaveDialog1.FileName),ComboBox2.Text );
//Session1.SaveConfigFile;
end else Exit;
//Session1.GetTableNames(Edit1.Text,'*.mdb',False,False,ComboBox3.Items);
//if ComboBox3.Items.IndexOf(Edit2.Text) = -1 then
//begin
// AppLication.MessageBox('对不起,这个表已经存在','提示',mb_ok+mb_IconInformation);
// Exit;
// end;
Showmessage('建表');
Query1.DatabaseName := Edit1.Text;
With Query1 do
begin
Close;
SQL.Clear ;
SQL.Add('Create Table a(F Char(10) null');
ExecSQL;
end;
Showmessage('建表成功');
end;procedure TForm1.Button4Click(Sender: TObject);
var
ap:TStringList; {字符串列表变量}
answer:Integer;
begin
ap:=TStringlist.Create;
Session.GetAliasNames(ap); {取得别名列表}
if (ap.IndexOf(Edit1.Text)=-1) then {判断别名是否存在}
begin
answer:=Application.MessageBox( '别名Cntssamp不存在,现在创建吗?','BDE信息窗口',mb_OKCancel);
{增加一个名为Cngzsamp的数据库别名}
if answer=IDCANCEL then begin
ap.Free;
Exit;
end;
Session.AddStandardAlias(Edit1.Text ,'D:\',ComboBox2.Text);
Session.SaveConfigFile; {BDE配置文件存盘}
end ; ap.Clear; {取得别名Cngzsamp中的所有表格名称列表}
Session.GetTableNames
(Edit1.Text,'',False,False,ap);
if (ap.IndexOf('TSK')=-1) then {判断表格是否存在}
begin
answer:=Application.MessageBox('别名Cntssamp中不存在表格TSK,现在创建吗?','表格信息窗口',mb_OKCancel);
if answer=IDCANCEL then begin
ap.Free;
Exit;
end;
with table1 do begin
Active:=false;
DatabaseName:='Cntssamp';
..........
ap.free
end;end.