在pb里可以同时连接两个数据库么?如何实现
rt 本人粉嫩新手小白求指点 谢谢各位大神
[解决办法]
Transaction mydb
mydb.DBMS = "O84 Oracle8/8i (8.x.4+)"
mydb.LogPass =""
mydb.ServerName = "fdztrun"
mydb.LogId = "system"
mydb.AutoCommit = False
connect using mydb;
select * from table using mydb;
[解决办法]
以前收藏的一个例子
//PB中同时连接多个数据库,如连接SQLServer2000和Oracle8
string ls_startupfile
ls_startupfile='hisini.ini'
sqlca.DBMS = ProfileString(ls_startupfile, "database", "dbms", "")
sqlca.database = ProfileString(ls_startupfile, "database", "database", "")
sqlca.userid = ProfileString(ls_startupfile, "database", "userid", "")
sqlca.dbpass = ProfileString(ls_startupfile, "database", "dbpass", "")
sqlca.logid = ProfileString(ls_startupfile, "database", "logid", "")
sqlca.logpass = ProfileString(ls_startupfile, "database", "LogPassWord", "")
sqlca.servername = ProfileString(ls_startupfile, "database", "servername", "")
sqlca.dbparm = ProfileString(ls_startupfile, "database", "dbparm", "")
remote_trans= CREATE transaction
remote_trans.DBMS = ProfileString(ls_startupfile, "Database_remote", "dbms", "")
remote_trans.database = ProfileString(ls_startupfile, "Database_remote", "database", "")
remote_trans.userid = ProfileString(ls_startupfile, "database_remote", "userid", "")
remote_trans.dbpass = ProfileString(ls_startupfile, "database_remote", "dbpass", "")
remote_trans.logid = ProfileString(ls_startupfile, "database_remote", "logid", "")
remote_trans.logpass = ProfileString(ls_startupfile, "database_remote", "LogPassWord", "")
remote_trans.servername = ProfileString(ls_startupfile, "database_remote", "servername", "")
remote_trans.dbparm = ProfileString(ls_startupfile, "database_remote", "dbparm", "")
//附hisini.ini
[Database]
DBMS=MSS Microsoft SQL Server 6.x
Database=his
UserId=
DatabasePassword=
ServerName=.
LogId=sa
Lock=
Prompt=0
computer='11'
ocx= 0
use0='之住院管理'
cfprint='1'
[Database_remote]
DBMS = "O84 Oracle8/8i(8.x.4+)"
ServerName = "oracle8"
LogId = "dba"
Database=zx
UserId=
DatabasePassword=
Lock=
Prompt=0
computer='11'
ocx= 0
cfprint='1'
[解决办法]
创建不同的Transaction。
[解决办法]
基本没用过SQLCA,一直自定义Transaction类然后各种实例化的飘过......