注册 登录
编程论坛 PowerBuilder

求助——pb连接局域网内的ORCL数据库代码怎么写?

空空剑客 发布于 2013-03-26 11:14, 2456 次点击
我是刚学pb没几天 让大家回答这么简单的问题见笑了  请多多帮助我 谢谢了
3 回复
#2
空空剑客2013-03-27 09:15
没人帮助啊
#3
wp2319572013-03-27 09:25
现在学pb的不知道多不多了
反正这里不多
#4
zhaoyun11282013-03-31 11:27
建一个ini文件,把连接信息配置进去
然后读取ini文件就可以
string ls_file
ls_file=".\cashier.ini"
SQLCA.DBMS       = ProfileString(ls_file,"database","DBMS"," ")

SQLCA.Database   = ProfileString(ls_file,"database","DataBase"," ")

SQLCA.LogID      = ProfileString(ls_file,"database","LogID"," ")

SQLCA.LogPass    = ProfileString(ls_file,"database","LogPassword"," ")

SQLCA.ServerName = ProfileString(ls_file,"database","ServerName"," ")

SQLCA.UserID     = ProfileString(ls_file,"database","UserID"," ")

SQLCA.DBPass     = ProfileString(ls_file,"database","DatabasePassword", " ")

SQLCA.Lock       = ProfileString(ls_file,"database","Lock"," ")

SQLCA.DbParm     = ProfileString(ls_file,"database","dbparm"," ")

SQLCA.autocommit = false
connect using SQLCA;
if SQLCA.sqlcode <> 0 then
    messagebox("错误提示","数据库连接失败,请检查配置文件"+SQLCA.sqlerrtext)
else
    open(w_login)
end if
1