操作系统: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