注册 登录
编程论坛 PowerBuilder

连接数据库的问题

赖蛤蟆 发布于 2007-03-10 09:59, 733 次点击
我在调试的时候怎么会出现 一个错误窗口.
请教各位大虾要怎么连接sql数据库才不会出错呢?
9 回复
#2
赖蛤蟆2007-03-10 10:00
sqlca.dbms="odbc"
sqlca.autocommit=false
sqlca.dbparm="commectstring='dsn=bookdatabase'"
connect;
dw_1.settransobject(sqlca)
dw_1.retrieve()
#3
notbig2007-03-11 22:16
后面还应加上用户名和密码
#4
赖蛤蟆2007-03-12 12:46

斑竹,请指教怎么加.
我自己加上去就出错

#5
赖蛤蟆2007-03-12 12:50
我在sql连接的过程中已经通过了用户名与密码了~
#6
notbig2007-03-12 17:57

这是直连的
//SQLCA.DBMS = "MSS Microsoft SQL Server"
//SQLCA.Database = "sample"
//SQLCA.LogPass = 'abc'
//SQLCA.ServerName = "localhost"
//SQLCA.LogId = "sa"
//SQLCA.AutoCommit = False
//SQLCA.DBParm = ""

#7
notbig2007-03-12 17:59
SQLCA.DBParm = "ConnectString='DSN=testmysql;UID=root;PWD='"
#8
赖蛤蟆2007-03-13 11:46

谢谢~

#9
赖蛤蟆2007-03-13 11:47
搞定
#10
赖蛤蟆2007-03-13 13:33
1