vb 连接oracle数据,数据类型不支持,急!!!1
执行到rs1.open处报错,数据类型不支持,代码如下:
Dim cn As New adodb.Connection
Dim cmd As New adodb.Command
Dim rs1 As New adodb.Recordset
Dim rs2 As New adodb.Recordset
Dim rs3 As New adodb.Recordset
Dim sql1 As String
Dim sql2 As String
Dim sql3 As String
Dim k1 As Integer
Dim k2 As Integer
Dim j As Integer
Dim msg As String
cn.ConnectionString = "Provider=MSDAORA.1;Password=223ds;User ID=qzdata;Data Source=192.13.8.17:1521/pdbqz;Persist Security Info=True"
cn.Open
rs1.ActiveConnection = cn
sql1 = "select * from QZDATA.QZ_GL_LOG where QZDATA.QZ_GL_LOG.LOGDATE=to_date('10-07-2013','DD-MM-YYYY')"
rs1.Source = sql1
rs1.Open
[解决办法]
A) LOGDATE 的数据类型不是 DATE?
B) 查询 SELECT to_date('10-07-2013','DD-MM-YYYY') FROM DUAL 是否正确?