首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

OLE DB 读取数据库 实时异常 帮忙看下原因

2012-03-02 
OLE DB 读取数据库 实时错误 帮忙看下原因Dim sPro As StringDim sDsn As StringDim sSer As StringDim Sc

OLE DB 读取数据库 实时错误 帮忙看下原因
Dim sPro As String
Dim sDsn As String
Dim sSer As String
Dim Scon As String
Dim Csql As String
Dim Conn As Object
Dim oRs As Object
Dim oCom As Object
Dim m, n, s
sPro = "Provider=WinCCOLEDBProvider.1;"
sDsn = ";Catalog=CC_WdlcWinc_11_07_21_23_14_18R;"
sSer = "DataSource=.\WinCC"
Scon = sPro + sDsn + sSer
Csql = "TAG:R,36,'0000-00-00 00:10:00.000','0000-00-00 00:00:00.000'"


Set Conn = CreateObject("ADODB.Connection")
Conn.connectionstring = Scon
Conn.cursorlocation = 3

Conn.open

Set oRs = CreateObject("ADODB.Recordset")
Set oCom = CreateObject("ADODB.Command")
oCom.CommandType = 1
Set oCom.Activeconnection = Conn

oCom.CommandText = Csql
Set oRs = oCom.Execute ‘执行到此句 就出现 实时错误 -2147467259 80004005 未指定的错误

[解决办法]
感觉我像是火星人,一点也看不懂
[解决办法]
我看了,可我好意思说没看懂?
[解决办法]
确定看不懂!不容易啊

热点排行