关于bde:求助解决 请用Delphi安装盘上的InstallShield做BDE安装盘 Delphi3的和Delphi5带的好用另外别名应程序中自动创建 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 BDE安装盘我没做成能不能给出一个创建别名的实例,多谢! 配置别名的程序代码:asl := Tstringlist.Create ; asl.Clear ; asl.Add ('Driver Name= MSSQL'); asl.Add ('Server Name= ' + servername); asl.Add ('Database Name= ' + Databasename); asl.Add ('User Name= ' + Username); asl.Add ('sqlqrymode=local'); if not Session.IsAlias ('STJ') then begin try Session.AddAlias ('STJ','MSSQL',ASL); finally asl.Free ; end;end else if Session.IsAlias ('STJ') then begin try Session.ModifyAlias ('STJ',ASL); finally asl.Free ; end; end;with Datamodule.dataBase1 dobegin iF Connected = true then Connected := false; aliasname := 'STJ'; params.Clear ; params.Add ('server name=' + servername); params.Add ('database name=' + Databasename); params.Add ('user name=' + loginname); params.Add ('password=' + loginword); loginprompt := false; keepconnection := true; try Connected := true; except application.MessageBox (pchar('无法启动数据库,请检查数据服务器是否已经启动!'),Pchar('错误'),mb_ok); application.Terminate ; exit; end;end;配置BDE注册的代码:procedure InitBde;var DataDirectory : string; ARegistry : TRegistry;begin DataDirectory := ExtractFilePath( Application.ExeName ); DataDirectory := DataDirectory+'bde\'; ARegistry := TRegistry.Create; with ARegistry do {创建一个TRegistry对象实例 } begin RootKey := HKEY_LOCAL_MACHINE;{指定根键为HKEY_LOCAL_MACHINE} if not OpenKey( 'Software\Borland\BLW32', False ) then begin// showmessage('key 1'); {写入BDE语言驱动程序所在的目录,即当前程序目录 } OpenKey( 'Software\Borland\BLW32', True ); WriteString( 'BLAPIPATH', DataDirectory ); end; CloseKey; {关闭主键,同时将信息写入注册表} RootKey := HKEY_LOCAL_MACHINE; if not OpenKey('Software\Borland\Database Engine',False) then begin// showmessage('key 2'); OpenKey('Software\Borland\Database Engine',True); WriteString( 'DLLPATH', DataDirectory ); end; CloseKey; {关闭主键,同时将信息写入注册表} Destroy; {释放内存 } end;end; 能不能做个BDE的安装盘给我? 如何读取文本每行内容?在线等候!!!!!!!!!!!!!!!! Listview 急!各位仁兄帮帮忙啦 OpenDialog的简单问题? 求助高手有关生成二进制文件的问题!谢谢! 如何得到日期的差???在线等待!!!! 请问版主大人,如何清空专家分。 如何检测局域网中其他的机子的网卡是否处于混杂模式? 在SQL SERVER 中用什么函数将日期型转换成‘yyyymmdd’的字符串?? TechnoFantasy(www.applevb.com) windoze(瞌睡窗) 能否交个朋友 qq:41233280 求文件上传之原理及算法 唉,如何写方案呢? 各位高手:bmp到tif,谢谢
能不能给出一个创建别名的实例,多谢!
asl.Clear ;
asl.Add ('Driver Name= MSSQL');
asl.Add ('Server Name= ' + servername);
asl.Add ('Database Name= ' + Databasename);
asl.Add ('User Name= ' + Username);
asl.Add ('sqlqrymode=local'); if not Session.IsAlias ('STJ') then
begin
try
Session.AddAlias ('STJ','MSSQL',ASL);
finally
asl.Free ;
end;
end
else if Session.IsAlias ('STJ') then
begin
try
Session.ModifyAlias ('STJ',ASL);
finally
asl.Free ;
end;
end;with Datamodule.dataBase1 do
begin
iF Connected = true then
Connected := false;
aliasname := 'STJ';
params.Clear ;
params.Add ('server name=' + servername);
params.Add ('database name=' + Databasename);
params.Add ('user name=' + loginname);
params.Add ('password=' + loginword);
loginprompt := false;
keepconnection := true; try
Connected := true;
except
application.MessageBox (pchar('无法启动数据库,请检查数据服务器是否已经启动!'),Pchar('错误'),mb_ok);
application.Terminate ;
exit;
end;
end;配置BDE注册的代码:
procedure InitBde;
var
DataDirectory : string;
ARegistry : TRegistry;
begin
DataDirectory := ExtractFilePath( Application.ExeName );
DataDirectory := DataDirectory+'bde\';
ARegistry := TRegistry.Create;
with ARegistry do {创建一个TRegistry对象实例 }
begin
RootKey := HKEY_LOCAL_MACHINE;{指定根键为HKEY_LOCAL_MACHINE}
if not OpenKey( 'Software\Borland\BLW32', False ) then
begin
// showmessage('key 1'); {写入BDE语言驱动程序所在的目录,即当前程序目录 }
OpenKey( 'Software\Borland\BLW32', True );
WriteString( 'BLAPIPATH', DataDirectory );
end;
CloseKey; {关闭主键,同时将信息写入注册表}
RootKey := HKEY_LOCAL_MACHINE;
if not OpenKey('Software\Borland\Database Engine',False) then
begin
// showmessage('key 2');
OpenKey('Software\Borland\Database Engine',True);
WriteString( 'DLLPATH', DataDirectory );
end;
CloseKey; {关闭主键,同时将信息写入注册表}
Destroy; {释放内存 }
end;
end;