D:\Program Files\Common Files\Borland Shared\BDE这是指bde安装的路径。假如你的程序需要自己安装bde(也就是只拷贝几个必要的dll到客户端的话),可以使用一下代码在你的程序中动态安装bde(注意,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
OpenKey( 'Software\Borland\BLW32', True );
WriteString( 'BLAPIPATH', DataDirectory );
end;
CloseKey; {关闭主键,同时将信息写入注册表}
RootKey := HKEY_LOCAL_MACHINE;
if not OpenKey('Software\Borland\Database Engine',False) then
begin
OpenKey('Software\Borland\Database Engine',True);
WriteString( 'DLLPATH', DataDirectory );
end;
CloseKey; {关闭主键,同时将信息写入注册表}
Destroy; {释放内存 }
end;
end;
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
OpenKey( 'Software\Borland\BLW32', True );
WriteString( 'BLAPIPATH', DataDirectory );
end;
CloseKey; {关闭主键,同时将信息写入注册表}
RootKey := HKEY_LOCAL_MACHINE;
if not OpenKey('Software\Borland\Database Engine',False) then
begin
OpenKey('Software\Borland\Database Engine',True);
WriteString( 'DLLPATH', DataDirectory );
end;
CloseKey; {关闭主键,同时将信息写入注册表}
Destroy; {释放内存 }
end;
end;
解决方案 »
- StringGrid+Adoquery的数据提交和更新问题
- 请DELPHI兼职教师
- 求救!为什么客户端程序放到另的机子就运行不了?
- ★★★如何让Edit控件只能输入一个汉字或一个字符?
- DELPHI 和SQL 的数据库制作安装程序问题
- 负责人让我写文档,结果写出来让人残不忍睹,各位兄弟,帮我看看,百分奉上
- 多人开发的问题
- 采用vfw进行视频传输,换到学校的机子上时对方接收视频有延迟,而在家里就正常
- 很菜的的一个问题,帮小弟一下吧。
- 关于在程序中调用Windows函数实现关机、重启以及控制面板中的各项内容的调用
- 问一个幼稚的问题,delphi6.0分为那几个版本,你们都用的哪一个。
- 大家帮我看看,为什么这样绘制时屏幕会不停的闪动?是不是画布属性设置有什么遗漏的?
用INSTALLSHIELD EXPRESS时不指定BDE在注册表中的值,而让程序第一次运行时动态确定。
还有可否给个联系方式