ADO 3704错误,不知道为什么
了缘 2004-12-11 02:35:22 Private Sub CmdQuery_Click()
Dim Rs As New ADODB.Recordset
Dim Conn As New ADODB.Connection
Conn.ConnectionTimeout = 600
Conn.CursorLocation = adUseServer
Conn.CommandTimeout = 600
Dim strSql As String
strConnString = "Provider=SQLOLEDB.1;Password=wecoo;Persist Security Info=True;User ID=sa;Initial Catalog=UDRP_app2;Data Source=UFSOFT3\sql1"
strSql = "exec dbo.s_proview_procsaleItemtype 2004"
' strSql = "select * from test"
Conn.Open strConnString
Rs.CursorLocation = adUseClient
' Rs.CursorType = adOpenStatic
Rs.Open strSql, Conn, adOpenStatic
' Set Rs = Conn.Execute("exec dbo.s_proview_procsaleItemtype 2004")
If Rs.EOF = False Then
Dim intI As Integer
intI = Rs.RecordCount
MsgBox intI
Set DataGrid.DataSource = Rs.DataSource
End If
Set Rs = Nothing
Set Conn = Nothing
End Sub
strSql = "exec dbo.s_proview_procsaleItemtype 2004"
' strSql = "select * from test"
如果换成下面的直接查询就没有问题,不知道为什么,求助,谢谢