TCP/IP:
"rovider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=XXX.XXX.XXX.XXX;Initial Catalog=MyCtlgackage Collection=MyPkgCol;Default Schema=Schema;User ID=MyUserassword=MyPW"
APPC:
"rovider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC Remote LU Alias=MyRemote;Initial Catalog=MyCtlgackage Collection=MyPkgCol;Default Schema=Schema;User ID=MyUserassword=MyPW"
IBM's OLE DB Provider (shipped with IBM DB2 UDB v7 or above)
TCP/IP:
Provider=IBMDADB2;Database=sample;HOSTNAME=db2hostROTOCOL=TCPIPORT=50000;uid=myUserName;pwd=myPwd;
试试按这种写法行不行:
Cnn.ConnectionString="rovider=IBMDADB2.1assword="+db2Pwd+"ersist Security Info=True;User ID="+db2Uid+";DBALIAS="+db2Sid+";Location="";Extended Properties="";"作者: TIB 时间: 2010-4-28 21:54
在国外一个论坛搜到的关于QTP连接DB2出现58004错误的解决办法:
--------------------------------------------------------------------------------
Problem Description: Error: "[IBM][CLI Driver] SQL 1042C An unexpected system error occured. SQLSTATE=58004"
The user receives a "[IBM][CLI Driver] SQL 1042C An unexpected system error occured. SQLSTATE=58004" error message when trying to connect to an IBM DB2 client using a Database Checkpoint or ADODB statements within the script.
Diagnosis: The existence of the <Quicktest Professional>/bin/QTPro.exe.Local file conflicts with the ability of ADODB to open the DB2 client.
Solution: Rename the QTPro.exe.Local file in the bin directory
The QTPro.exe.Local file is used for redirection of DLLs that QuickTest Professional loads. In the case of coexistence problems with other Mercury products, the file instructs Windows API to load DLLs from the <QuickTest Professional>\bin directory instead of other directories. This is important for the coexistence between QuickTest Professional, LoadRunner, and old versions of Astra LoadTest.
Renaming this file should solve the problem. QuickTest Professional will work fine without QTPro.exe.Local, unless LoadRunner or Astra LoadTest are installed on the machine.
1. Close QuickTest Professional.
2. Open Windows Explorer, and navigate to the QuickTest Professional installation directory.
3. In the bin directory, locate the QTPro.exe.Local file, and rename it (for example, QTPro.exe.Local.old).
4. Restart QuickTest Professional.
After renaming the file, QuickTest Professional should be able to connect to the database and work with it as expected. If the error continues, try removing unneeded parameters in the connection string.作者: moguiku 时间: 2010-4-29 15:16 标题: 回复 13# 的帖子 真的是可以啊!
太感谢了!
把那个文件一重命名,一切OK了!
只是这知道这个文件是干什么用的啊?改了以后会不会对以后的测试啥的有影响啊作者: TIB 时间: 2010-4-29 15:28
The QTPro.exe.Local file is used for redirection of DLLs that QuickTest Professional loads. In the case of coexistence problems with other Mercury products, the file instructs Windows API to load DLLs from the <QuickTest Professional>\bin directory instead of other directories. This is important for the coexistence between QuickTest Professional, LoadRunner, and old versions of Astra LoadTest.