|
5#
楼主 |
发表于 2006-4-29 11:30:51
|
只看该作者
郁闷
我用三楼的脚本,运行时没有执行啊,报告没报错;还要其它设置么?odbc:测试时能连接上(oracle in oraHome92),用PL/SQL Developer能对数库操作.
脚本写错?
Function OpenConnection (dataSource)
Set cnn = CreateObject("ADODB.Connection")
cnn.ConnectionString = "Provider=oracle in oraHome92;Persist Security Info=true;User ID=XXX;Password=XXX;Data Source=192.168.0.2" &dataSource
cnn.Open
Set OpenConnection = cnn
If cnn.State = 0 Then
Reporter.ReportEvent micFail, "testing", "连接数据库失败"
else
Reporter.ReportEvent micPass, "testing", "连接数据库成功"
End If
End Function
另一种:
Set Conn = CreateObject("ADODB.Connection" )
Conn.open "DRIVER={oracle in oraHome92};SERVER=192.168.0.2;PORT=1521;DATABASE=DBSERVER; USER=ebmsghyy20060329;PASSWORD=ebmsghyy20060329;"
Set Rs = CreateObject ("ADODB.Recordset" )
If conn.State = 0 Then
Reporter.ReportEvent micFail, "testing", "连接数据库失败"
else
Reporter.ReportEvent micPass, "testing", "连接数据库成功"
End If
错误:[Oracle][ODBC][Ora]ORA-12560: TNS: 协议适配器错误 |
|