|
win7 32位没问题可以运行,win7 64位就报错,我查了一下,应该是ODBC的问题
有没有谁有win7 64位下用ODBC连接ORACLE数据库的经验,帮忙分享一下,谢了!
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <CoProc.au3>
Dim $oMyError = ObjEvent("AutoIt.Error", "ComError")
Dim $RecordNum
Dim $objConnection, $TableContents, $QueryCode
Dim $aResult
Dim $UserName = "operate"
Dim $Password = "operate"
Dim $Database = "DCMDB"
Dim $DBServerName = "SZDPDCM.SUZ.COM"
Dim $Driver = "{Microsoft ODBC for Oracle}"
Dim $Port = 1521
Dim $Table_SICAttr = "dcc.SI_Attr"
Dim $Table_SICCONTROL = "dcc.si_cont"
Dim $DSN = "DRIVER=" & $Driver & "; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=" & $DBServerName & ")(PORT=" & $Port & "))" & _
"(CONNECT_DATA=(SID=" & $Database & "))); uid=" & $UserName & ";pwd=" & $Password & ";"
While 1
$objConnection = ObjCreate("ADODB.Connection")
$objConnection.open($DSN)
$QueryCode = "select count(*) from " & $Table_SICCONTROL
$TableContents = $objConnection.Execute($QueryCode)
$aResult = $TableContents.GetRows()
$RecordNum = $aResult[0][0]
MsgBox(0,"all","$RecordNum")
$objConnection.close()
WEnd |
|