PB连不上SQL2000

来源:百度知道 编辑:UC知道 时间:2024/05/31 20:53:57
代码是这样的,请高手帮忙看一下啊!
// Profile zhuce
SQLCA.DBMS = "MSS Microsoft SQL Server 6.x"
SQLCA.Database = "table"
SQLCA.LogPass = "123456"
SQLCA.ServerName = "wang"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""
conenct using sqlca
if sqlca.sqlcode <> 0 then
messagebox("系统提示!","不能连接数据库,请询问系统管理员",stopsign!)
return
end if
不想使用ODBC,要使用专用接口,加数据库那段是从PB的database profile setup-microsfot sql server 6.x窗口上直接粘贴过来的,只把密码改了,并且测试连接成功啊!
请高手帮我写个代码啊!

你要描述具体点
而且你的语句写的也不对

先看看你的odbc是否正确,然后
在open事件中写入:
// Profile zhuce
SQLCA.DBMS = "odbc"
SQLCA.AutoCommit=False
SQLCA.DBParm="Connectstring='DNS=table '"
connect using sqlca; //这里要分号,楼主好像没有哦
if aqlca.sqlca<>0 then
Messagebox("数据库连接失败!")
return
end if
open(w_main)