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的程序
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的程序
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货