我用的是sql数据库,用的是installshield express for delphi5打包,bde也打包了,库文件和日志文件也加入了,到别的机器安装后,

  • 主题发起人 主题发起人 wanglong12
  • 开始时间 开始时间
W

wanglong12

Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是sql数据库,用的是installshield express for delphi5打包,bde也打包了,库文件和日志文件也加入了,到别的机器安装后,bde有是有了,但是属性都没有改,一气之下,手动改了,连接此bde却说:未能在sysdatabase中找到数据库。高手帮忙啊?到底有没有人会 (200分)<br />不会不罢休?
 
打包时不配置数据库的alias,到客户端在配置看看
 
不会啊!打包了还出错???别名建立了吗??
 
库文件进行恢复了吗?如何恢复的?
 
在BDE配置的Server name服務器中有沒有裝Sql server?.
或此Sql serer有沒有你的數據庫或有沒有恢復此數據庫?。
 
没恢复数据库,难道还要安装sql并且手动恢复数据库吗?
 
在數據庫服務器上,裝上Sql server,利用恢復功能
將你的數據庫備份文件恢復到此數據庫服務器中。
 
怎样把恢复数据库的功能放到安装程序中呢?
 
你在客户端的数据库里没有建立数据库,应该使用SQL把数据库在客户端建立起来!
 
你有没有数据库的数据文件?
有的话,在你连接到数据库之后,执行sp_attach_db '数据库名称','数据库的物理文件路径'
这样就能把你的数据库连接到sql server上了。
你在用
use matser
go
select * from dbo.sysdatabase where [name]='数据库名称'
看看有没有?
 
我想的是安装到任何一台计算机上,那台机器并没有装sql,怎么办啊?
 
你可以在DELPHI发布工具中改写注册表,然后做好一个BDE的CFG文件,直接发布即可
 
to kiki00:
能讲详细点吗?听不懂!
 
BDE用installshield express for delphi5打包时不会建立BDE别名。
我都是在程序执行时修改?
 
没恢复数据库,难道还要安装sql并且手动恢复数据库吗?
-------------------------->当然。手动可不必。
 
你解决了吗?仅仅打包是不够的,要改注册表的.真是可以.什么乱七八糟的.下面的代码试试看
function FunAddBde()
STRING SOURCE_DIR,TARGET_DIR,subdir;
STRING szKey, szClass, szMsg, szTitle, szNumName, szNumValue, svNumValue;
NUMBER nvType, nvSize;
NUMBER nRootKey;
begin
SOURCE_DIR = SRCDIR;
TARGET_DIR = TARGETDIR ;
//StrSub(subdir,SRCDIR,0,StrLength(SRCDIR)-2);
//SRCDIR = subdir + "2";
SRCDIR = SRCDIR + "//BDE";
TARGETDIR = COMMONFILES+"//Borland Shared//BDE" ;
Enable(STATUS);
StatusUpdate( ON, 100 );
CopyFile("*.*", "*.*");
Disable(STATUS);
SRCDIR = SOURCE_DIR;
TARGETDIR = TARGET_DIR;
nRootKey = HKEY_LOCAL_MACHINE;
RegDBSetDefaultRoot(nRootKey);
szKey = "SOFTWARE//Borland";
szClass = "";
RegDBCreateKeyEx(szKey, szClass);
nvType = REGDB_STRING;
szKey = "SOFTWARE//Borland//"+"//BLW32";
RegDBSetKeyValueEx(szKey,"Blapipath",nvType,WINDISK+"//"+Definefloder+"//Borland Shared//BDE",-1);
szKey = "SOFTWARE//Borland//"+"//Database Engine";
RegDBSetKeyValueEx(szKey,"Dllpath",nvType,WINDISK+"//"+Definefloder+"//Borland Shared//BDE",-1);
RegDBSetKeyValueEx(szKey,"CONFIGFILE01",nvType,WINDISK+"//"+Definefloder+"//Borland Shared//BDE//Idapi.cfg",-1);
RegDBSetKeyValueEx(szKey,"RESOUCE",nvType,"0009",-1);
RegDBSetKeyValueEx(szKey,"SaveConfig",nvType,"WIN32",-1);
RegDBSetKeyValueEx(szKey,"UseCount",nvType,"3",-1);
szKey = "SOFTWARE//Borland//Database Engine//"+"//settings";
RegDBCreateKeyEx(szKey,szClass);
szKey = "SOFTWARE//Borland//Database Engine//settings"+"//SYSTEM//FORMATS//DATE";
RegDBSetKeyValueEx(szKey,"SEPARATOR",nvType,"/",-1);
RegDBSetKeyValueEx(szKey,"MODE",nvType,"0",-1);
RegDBSetKeyValueEx(szKey,"FOURDIGITYEAR",nvType,"FALSE",-1);
RegDBSetKeyValueEx(szKey,"YEARBIASED",nvType,"TRUE",-1);
RegDBSetKeyValueEx(szKey,"LEADINGZEROM",nvType,"FALSE",-1);
RegDBSetKeyValueEx(szKey,"LEADINGZEROD",nvType,"FALSE",-1);
szKey = "SOFTWARE//Borland//Database Engine//settings"+"//SYSTEM//FORMATS//NUMBER";
RegDBSetKeyValueEx(szKey,"DECIMALSEPARATOR",nvType,".",-1);
RegDBSetKeyValueEx(szKey,"THOUSANDSEPARATOR",nvType,",",-1);
RegDBSetKeyValueEx(szKey,"DECIMALDIGITS",nvType,"2",-1);
RegDBSetKeyValueEx(szKey,"LEADINGZERON",nvType,"TRUE",-1);
szKey = "SOFTWARE//Borland//Database Engine//settings"+"//SYSTEM//FORMATS//TIME";
RegDBSetKeyValueEx(szKey,"TWELVEHOUR",nvType,"TRUE",-1);
RegDBSetKeyValueEx(szKey,"AMSTRING",nvType,"AM",-1);
RegDBSetKeyValueEx(szKey,"PMSTRING",nvType,"PM",-1);
RegDBSetKeyValueEx(szKey,"SECONDS",nvType,"TRUE",-1);
RegDBSetKeyValueEx(szKey,"MILSECONDS",nvType,"FALSE",-1);
szKey = "SOFTWARE//Borland//Database Engine//settings"+"//SYSTEM//INIT";
RegDBSetKeyValueEx(szKey,"VERSION",nvType,"4.0",-1);
RegDBSetKeyValueEx(szKey,"LOCAL SHARE",nvType,"FALSE",-1);
RegDBSetKeyValueEx(szKey,"MINBUFSIZE",nvType,"128",-1);
RegDBSetKeyValueEx(szKey,"MAXBUFSIZE",nvType,"2048",-1);
RegDBSetKeyValueEx(szKey,"LANGDRIVER",nvType,"china",-1);
RegDBSetKeyValueEx(szKey,"MAXFILEHANDLES",nvType,"48",-1);
RegDBSetKeyValueEx(szKey,"SYSFLAGS",nvType,"0",-1);
RegDBSetKeyValueEx(szKey,"LOW MEMORY USAGE LIMIT",nvType,"32",-1);
RegDBSetKeyValueEx(szKey,"AUTO ODBC",nvType,"FALSE",-1);
RegDBSetKeyValueEx(szKey,"DEFAULT DRIVER",nvType,"PARADOX",-1);
RegDBSetKeyValueEx(szKey,"MEMSIZE",nvType,"16",-1);
RegDBSetKeyValueEx(szKey,"SHAREDMEMSIZE",nvType,"2048",-1);
RegDBSetKeyValueEx(szKey,"SHAREDMEMLOCATION",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"DATA REPOSITORY",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"SQLQRYMODE",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"MTS POOLING",nvType,"FALSE",-1);
szKey = "SOFTWARE//Borland//Database Engine//Settings"+"//DRIVERS//DB2//DB OPEN";
RegDBSetKeyValueEx(szKey,"USER NAME",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"DB2 DSN",nvType,"DB2_SERVER",-1);
RegDBSetKeyValueEx(szKey,"OPEN MODE",nvType,"READ/WRITE",-1);
RegDBSetKeyValueEx(szKey,"SCHEMA CACHE SIZE",nvType,"8",-1);
RegDBSetKeyValueEx(szKey,"LANGDRIVER",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"SQLQRYMODE",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"SQLPASSTHRU MODE",nvType,"SHARED AUTOCOMMIT",-1);
RegDBSetKeyValueEx(szKey,"SCHEMA CACHE TIME",nvType,"-1",-1);
RegDBSetKeyValueEx(szKey,"MAX ROWS",nvType,"-1",-1);
RegDBSetKeyValueEx(szKey,"BATCH COUNT",nvType,"200",-1);
RegDBSetKeyValueEx(szKey,"ENABLE SCHEMA CACHE",nvType,"FALSE",-1);
RegDBSetKeyValueEx(szKey,"SCHEMA CACHE DIR",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"ENABLE BCD",nvType,"FALSE",-1);
RegDBSetKeyValueEx(szKey,"ROWSET SIZE",nvType,"20",-1);
RegDBSetKeyValueEx(szKey,"BLOBS TO CACHE",nvType,"64",-1);
RegDBSetKeyValueEx(szKey,"BLOB SIZE",nvType,"32",-1);
szKey = "SOFTWARE//Borland//Database Engine//Settings"+"//DRIVERS//DB2//INIT";
RegDBSetKeyValueEx(szKey,"VERSION",nvType,"4.0",-1);
RegDBSetKeyValueEx(szKey,"TYPE",nvType,"SERVER",-1);
RegDBSetKeyValueEx(szKey,"DLL32",nvType,"SQLDB2V5.DLL",-1);
RegDBSetKeyValueEx(szKey,"DRIVER",nvType,"IBM DB2 DRIVER",-1);
RegDBSetKeyValueEx(szKey,"DRIVER FLAGS",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"TRACE MODE",nvType,"0",-1);
szKey = "SOFTWARE//Borland//Database Engine//Settings"+"//DRIVERS//MSACCESS//DB OPEN";
RegDBSetKeyValueEx(szKey,"DATABASE NAME",nvType,"DRIVERS:/PATH/DATABASE.MDB",-1);
RegDBSetKeyValueEx(szKey,"USER NAME",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"OPEN MODE",nvType,"READ/WRITE",-1);
RegDBSetKeyValueEx(szKey,"LANGDRIVER",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"SYSTEM DATABASE",nvType,"",-1);
szKey = "SOFTWARE//Borland//Database Engine//Settings"+"//DRIVERS//MSACCESS//INIT";
RegDBSetKeyValueEx(szKey,"VERSION",nvType,"1.0",-1);
RegDBSetKeyValueEx(szKey,"TYPE",nvType,"SERVER",-1);
RegDBSetKeyValueEx(szKey,"DLL32",nvType,"IDDAO32.DLL",-1);
RegDBSetKeyValueEx(szKey,"DRIVER FLAGS",nvType,"",-1);
RegDBSetKeyValueEx(szKey,"TRACE MODE",nvType,"0",-1);
return 0;
end;

将上面的代码放到你的Setup.rul中。至于你的sybase可以参照来写。
 
Sybase客户端要建立与服务器的连接,或者用工具(如InstallShield Express 3.53)
将相应的Dll打进去即可,我也遇到过这种情况,你试试!
 
我用INSTALLSHIELD做DELPHI5程序打包,
安装后出现提示'数据库无法连接'
我用的是BED中的MSACCESS引擎做的连接
怎样可以解决
 
但是在用DELPHI5安装一下BDE引擎就可以了
 
后退
顶部