求指导,PB12.0 怎么用ini文件 连接sql 2005数据库
求指导,PB12.0 如何用ini文件 连接sql 2005数据库
我的dbconnect.ini文件内容
[Database]
DBMS=ADO.Net
Database=
UserId=
DatabasePassword=19ee3e1f625f6c8055b5747396669c0c
LogId=sa
LogPassword=4f7075b8febed3dd8655417e208b410f
ServerName=
DBParm=Namespace='System.Data.OleDb',Provider='SQLOLEDB',DataSource='OEM-20131031PEE',Database='mytest'
Lock=
Prompt=FALSE
AutoCommit=FALSE
NewLogic=EAS
-------------------------------------------------------------
我的open()事件里的内容
string str_file
//获取数据库配置文件,目录相对当前应用程序根目录
str_file = "dbconnect.ini"
// 判断指定的INI文件是否存在
if not FileExists (str_file) then
messagebox("提示!","ini文件不存在!",exclamation!,ok!,2)
return
end if
SQLCA.DBMS = ProfileString(str_file,"database","DBMS"," ")
SQLCA.Database = ProfileString(str_file,"database","DataBase"," ")
SQLCA.LogID = ProfileString(str_file,"database","LogID"," ")
SQLCA.LogPass = ProfileString(str_file,"database","LogPassword"," ")
SQLCA.ServerName = ProfileString(str_file,"database","ServerName"," ")
SQLCA.UserID = ProfileString(str_file,"database","UserID"," ")
SQLCA.DBPass = ProfileString(str_file,"database","DatabasePassword", " ")
SQLCA.Lock = ProfileString(str_file,"database","Lock"," ")
SQLCA.DbParm = ProfileString(str_file,"database","dbparm"," ")
SQLCA.autocommit = false
connect using sqlca;
open(w_test)
用这个连接不上啊。。。求助!!!
------解决方案--------------------
DatabasePassword=19ee3e1f625f6c8055b5747396669c0c
LogId=sa
LogPassword=4f7075b8febed3dd8655417e208b410f
1.密码在ini里加密了.你读取出来连数据库的时候解密了吗?
2.没连上数据库,把sqlerrtext打出来自己研究吧
我的dbconnect.ini文件内容
[Database]
DBMS=ADO.Net
Database=
UserId=
DatabasePassword=19ee3e1f625f6c8055b5747396669c0c
LogId=sa
LogPassword=4f7075b8febed3dd8655417e208b410f
ServerName=
DBParm=Namespace='System.Data.OleDb',Provider='SQLOLEDB',DataSource='OEM-20131031PEE',Database='mytest'
Lock=
Prompt=FALSE
AutoCommit=FALSE
NewLogic=EAS
-------------------------------------------------------------
我的open()事件里的内容
string str_file
//获取数据库配置文件,目录相对当前应用程序根目录
str_file = "dbconnect.ini"
// 判断指定的INI文件是否存在
if not FileExists (str_file) then
messagebox("提示!","ini文件不存在!",exclamation!,ok!,2)
return
end if
SQLCA.DBMS = ProfileString(str_file,"database","DBMS"," ")
SQLCA.Database = ProfileString(str_file,"database","DataBase"," ")
SQLCA.LogID = ProfileString(str_file,"database","LogID"," ")
SQLCA.LogPass = ProfileString(str_file,"database","LogPassword"," ")
SQLCA.ServerName = ProfileString(str_file,"database","ServerName"," ")
SQLCA.UserID = ProfileString(str_file,"database","UserID"," ")
SQLCA.DBPass = ProfileString(str_file,"database","DatabasePassword", " ")
SQLCA.Lock = ProfileString(str_file,"database","Lock"," ")
SQLCA.DbParm = ProfileString(str_file,"database","dbparm"," ")
SQLCA.autocommit = false
connect using sqlca;
open(w_test)
用这个连接不上啊。。。求助!!!
连接数据库
powerbuilder12.0
sql server 2005
------解决方案--------------------
DatabasePassword=19ee3e1f625f6c8055b5747396669c0c
LogId=sa
LogPassword=4f7075b8febed3dd8655417e208b410f
1.密码在ini里加密了.你读取出来连数据库的时候解密了吗?
2.没连上数据库,把sqlerrtext打出来自己研究吧