求指导,PB12.0 如何用ini文件 连接sql 2005数据库
16lz
2021-01-22
我的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()事件里的内容
stringstr_file
//获取数据库配置文件,目录相对当前应用程序根目录
str_file="dbconnect.ini"
//判断指定的INI文件是否存在
ifnotFileExists(str_file)then
messagebox("提示!","ini文件不存在!",exclamation!,ok!,2)
return
endif
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
connectusingsqlca;
open(w_test)
用这个连接不上啊。。。求助!!!
DatabasePassword=19ee3e1f625f6c8055b5747396669c0c
LogId=sa
LogPassword=4f7075b8febed3dd8655417e208b410f
1.密码在ini里加密了.你读取出来连数据库的时候解密了吗?
2.没连上数据库,把sqlerrtext打出来自己研究吧
[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()事件里的内容
stringstr_file
//获取数据库配置文件,目录相对当前应用程序根目录
str_file="dbconnect.ini"
//判断指定的INI文件是否存在
ifnotFileExists(str_file)then
messagebox("提示!","ini文件不存在!",exclamation!,ok!,2)
return
endif
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
connectusingsqlca;
open(w_test)
用这个连接不上啊。。。求助!!!
2 个解决方案
#1
DatabasePassword=19ee3e1f625f6c8055b5747396669c0c
LogId=sa
LogPassword=4f7075b8febed3dd8655417e208b410f
1.密码在ini里加密了.你读取出来连数据库的时候解密了吗?
2.没连上数据库,把sqlerrtext打出来自己研究吧
更多相关文章
- logstash-jdbc-input与mysql数据库同步
- 数据库事务——还是这是一个规范化问题?
- fmdb 数据库升级1-----增加表字段
- SQL Server 2008 数据库镜像部署实例之三 配置见证服务器
- IFX数据库访问介绍
- JDBC连接并使用mysql数据库
- 从数据库sql中删除一个单词
- mysql数据库之表的操作
- 教你如何彻底卸载MySQL数据库