数据库的链接

jianghuxiaozi 2002-01-09 09:39:41
刚接手一个任务:修改一个用PB6.5编写的系统。数据库市SQL SERVER6.5,但我不知怎样把程序和数据库连结起来!请高手指教!!!
...全文
62 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
sohome 2002-01-09
  • 打赏
  • 举报
回复
写一个ini文件
例如:
[DATABASE]
DBNAME=****
SERVERNAME=****
USERID=*****
LOGINID=*****
.......

然后调用-连接
pbworm 2002-01-09
  • 打赏
  • 举报
回复
// Profile consume,get everyitems from consumeManager.ini
SQLCA.DBMS = profileString("consumeManager.ini","dataBase","DBMS","")
SQLCA.Database = profileString("consumeManager.ini","dataBase","dataBase","")
SQLCA.ServerName = profileString("consumeManager.ini","dataBase","serverName","")
SQLCA.LogId = profileString("consumeManager.ini","dataBase","logId","")
If profileInt("consumeManager.ini","dataBase","autoCommit",0) = 0 Then
SQLCA.AutoCommit = False
Else
SQLCA.AutoCommit = True
End If
SQLCA.DBParm = ""

//建立和数据库的连接
Connect Using Sqlca;

//数据库未连接上或连接错误则终止程序的运行
If sqlca.SqlCode <> 0 Then
messageBox('错误','异常错误:未连接上数据库~r~n网络不通、服务器未开启或用户端配置不正确')
Halt
End If

//打开登录窗口
open (w_login)

我的是70的,65应该差不多

754

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧