首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

PowerBuilder11.5怎么连接linux下的数据库

2013-07-04 
PowerBuilder11.5如何连接linux下的数据库?操作系统:win7 32位,PB版本:11.5oracle数据库安装在Vmware虚拟

PowerBuilder11.5如何连接linux下的数据库?
操作系统:win7 32位,PB版本:11.5
oracle数据库安装在Vmware虚拟机(IP:192.168.182.132)中。
在win7下使用客户端Oracle Enterprise Manager Console可以连接

但在使用PB连接的时候报错:ORA-12154:TNS:could not resolve the connect identifier specified

// Profile centos
SQLCA.DBMS = "O10 Oracle10g (10.1.0)"
SQLCA.LogPass = <******>
SQLCA.ServerName = "orcl_192.168.182.132"
SQLCA.LogId = "system"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""


感觉中间少了个步骤,就是PB连接远程数据库为什么只有指定servername这种,那么这个servername指向的IP在哪设置? Linux PowerBuilder Oracle Windows?7 数据库
[解决办法]
SQLCA.DBMS = "O10 Oracle10g (10.1.0)"
SQLCA.LogPass = "arcpex"
SQLCA.ServerName = "orcl"
SQLCA.LogId = "system"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""

string str1;
str1=string(SQLCA.SQLCODE);
connect using sqlca;
if SQLCA.SQLCODE=0 then
messagebox('hit','success!')
else
messagebox('',"出错信息:"+sqlca.SQLErrText+","+str1)
//open(w_main)

end if

热点排行