powerbuilder连SQL数据库有问题啊!!!!!!急急急急急急急

来源:百度知道 编辑:UC知道 时间:2024/05/28 19:42:51
我用PB连接SQL数据库,在PB中显示正确连上了,没有一点问题,但是运行起来就提示连不上数据库,让我检查数据库是否连上,或配置出错,能是配置出错吗,我反复改了,也不知道怎么对!我6月20号就答辩了,很着急,谢谢各位了!!!!!!524240227 我的QQ
我的配置文件代码是:[DataBase]
DBMS=MSS Microsoft SQL Server
Database=fzxs
UserId=
DatabasePassword =
LogId=sa
LogPassword=
ServerName=306-B40C313BE5A
DbParm=
检查错误时候,代码是这样的:string ls_inifile ="fzxs.ini"
sqlca.DBMS = ProfileString ("dbfzxs.INI", "database", "dbms", "MSS Microsoft SQL Server")
sqlca.database = ProfileString ("dbfzxs.INI", "database", "database", "fzxs")
sqlca.logid = ProfileString ("dbfzxs.INI", "database", "logid", "sa")
sqlca.logpass = ProfileString ("dbfzxs.INI", "database", "LogPassWord","")
sqlca.servername=ProfileString("dbfzxs.INI","database", "servername", "306-B40C313BE

你可以把fzxs.ini的路径加进去.不用把参数都写出来.改成这样试试.
比如你的fzxs.ini路径为c:\pbexe\fzxs.ini

SQLCA.DBMS = ProfileString('c:\pbexe\fzxs\pb.ini','database','DBMS','')
SQLCA.Database = ProfileString('c:\pbexe\fzxs\pb.ini','database','Database','')
SQLCA.LogID = ProfileString('c:\pbexe\fzxs\pb.ini','database','LogId','')
SQLCA.LogPass = ProfileString('c:\pbexe\fzxs\pb.ini','database','Logpass','')
SQLCA.ServerName= ProfileString('c:\pbexe\fzxs\pb.ini','database','ServerName','')
SQLCA.UserID = ProfileString('c:\pbexe\fzxs\pb.ini','database','UserId','')
SQLCA.DBPass = ProfileString('c:\pbexe\fzxs\pb.ini','database','DatabasePassword',''