PB9.0连接数据库的问题???救命啊???

fhq506187001 2008-07-31 11:06:07
// Profile Aaa
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Connectstring='DSN=aaa'"


这是我在PB里创建的库,,但是在后面添加的表里面的字段却显示不出来,测试结果是连接成功!!本人想自己学PB,买了本教材,这个就是按照教材上做的可是没有达到教材的显示的结果啊??为什么它连的是什么库啊??我的机械上SQL和OCRACLE都装了服务器端的?我应该怎么连接呢???
...全文
375 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
springfun 2008-08-07
  • 打赏
  • 举报
回复
connect using sqlca;
if sqlca.sqlcode < 0 then
messagebox("","数据库连接失败!")
rollback using sqlca;
else
messagebox("","数据库连接成功!")
commit using sqlca;
end if
orcd 2008-07-31
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 wuyingchen 的回复:]
可以这么去连接:

SQLCA.DBMS = "MSS Microsoft SQL Server"
SQLCA.Database = "new"
SQLCA.LogPass = "sa"
SQLCA.ServerName = "ibmserver"
SQLCA.LogId = "sa" //密码
SQLCA.AutoCommit = True
SQLCA.DBParm = ""


connect using sqlca;

if sqlca.sqlcode >= 0 then
open(w_main)
end if
[/Quote]
这种连接方式就行
fhq506187001 2008-07-31
  • 打赏
  • 举报
回复
我想连接SQL 库
orcd 2008-07-31
  • 打赏
  • 举报
回复
你也没有说你想连接什么库啊,你的数据源配置的对应的哪个库啊?
正正 2008-07-31
  • 打赏
  • 举报
回复
可以这么去连接:

SQLCA.DBMS = "MSS Microsoft SQL Server"
SQLCA.Database = "new"
SQLCA.LogPass = "sa"
SQLCA.ServerName = "ibmserver"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = True
SQLCA.DBParm = ""


connect using sqlca;

if sqlca.sqlcode >= 0 then
open(w_main)
end if
青锋-SS 2008-07-31
  • 打赏
  • 举报
回复
PB自带的是ASA数据库

scf_620726 2008-07-31
  • 打赏
  • 举报
回复
第一:你所写的没有错误;
第二:你少了连接
第三:在你现在的基础上填加上:
connect using sqlca;
if sqlca.sqlcode < 0 then
messagebox("","数据库连接失败!")
rollback;
else
messagebox("","数据库连接成功!")
commit;
end if
lllyyymmm 2008-07-31
  • 打赏
  • 举报
回复
SQLCA.DBMS = "MSS Microsoft SQL Server"
SQLCA.Database = "new"
SQLCA.LogPass = "sa"
SQLCA.ServerName = "127.0.0.1"
SQLCA.LogId = "sa" //密码
SQLCA.AutoCommit = True
SQLCA.DBParm = ""


connect using sqlca;

if sqlca.sqlcode >= 0 then
open(w_main)
end if
SKY_4K_PPM 2008-07-31
  • 打赏
  • 举报
回复
创建好自己的数据库,连接的话,参考楼上!

754

社区成员

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

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