国产免费AV|泡泡玛特欧洲总部将设在伦敦|中文天堂网www新版资源在线|一本久道综合在线中文|国精产品一二三产区的使用方法|香蕉鱼在线观看|www.27eee

 找回密碼
 注冊
搜索

winccl與ORACLE

[復制鏈接]
樓主
sonypower 發表于 2016-7-8 22:23:45 | 只看該作者 |倒序瀏覽 |閱讀模式
Dim objTag
    Dim strConnectionString
    Dim strSQL
    Dim lngCount
    Dim lngValue
    Dim objConnection, objRecordset, objCommand

Const hostName = "192.168.0.211"
Const portNo = "1522"
Const srvSID = "ORCL"
Const usrID = "ID"
Const usrPwd = "PASS"


  strDriver = "Driver={Microsoft ODBC for Oracle};"
  strParams = "CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" + hostName + ")(PORT=" + portNo + "))(CONNECT_DATA=(SID=" + srvSID + ")));"
  strUser = "UID=" + usrID + ";PWD=" + usrPwd + ";"

  strConnectionString = strDriver + strParams + strUser


     strConnectionString = "Provider=MSDASQL;DSN=orclConnect;UID=ID;PWD=PASS"
     strSQL = "select score from test where name = 'NAME'"
     Set objConnection = CreateObject("ADODB.Connection")
     objConnection.ConnectionString = strConnectionString
     objConnection.Open
     Set objRecordset = CreateObject("ADODB.Recordset")
     Set objCommand = CreateObject("ADODB.Command")
     objCommand.ActiveConnection = objConnection
     objCommand.CommandText = strSQL
     Set objRecordset = objCommand.Execute
     lngCount = objRecordset.Fields.Count
     If (lngCount > 0) Then
     objRecordset.movefirst
     lngValue = objRecordset.Fields(0).value
     End If

    Set objCommand = Nothing
    objConnection.Close
    Set objRecordset = Nothing
    Set objConnection = Nothing

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規則

手機版|小黑屋|ELEOK |網站地圖

GMT+8, 2026-5-26 11:03

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回復 返回頂部 返回列表