请教大家一个问题(关于执行存储过程时出现的奇怪问题)。
Public Sub display_jy(ByVal searchType As Byte, ByVal XH As String, ByVal SH As String, ByVal JSRQFrom As Double, ByVal JSRQTo As Double, ByVal HSRQFrom As Double, ByVal HSRQTo As Double)Dim objRs As New ADODB.Recordset, i As Integer, str As String
str = CStr(searchType) & ",'" & XH & "','" & SH & "'," & CStr(JSRQFrom) & "," & CStr(JSRQTo) & "," & CStr(HSRQFrom) & "," & CStr(HSRQTo)
Set objRs = MyConnection.Execute("Exec XSTS_Search" & str)
MSFlexGrid1.Rows = 1
Do Until objRs.EOF
i = i + 1
MSFlexGrid1.Rows = i + 1
MSFlexGrid1.TextMatrix(i, 0) = i
For j = 1 To MSFlexGrid1.Cols - 1
If Not IsNull(objRs.Fields(j - 1).Value) Then
MSFlexGrid1.TextMatrix(i, j) = CStr(objRs.Fields(j - 1).Value)
End If
Next
objRs.MoveNext
Loop
Set objRs = Nothing
End Sub
我做的是图书借阅管理系统上面是借书登记界面的一部分代码(是执行一个存储过程),运行的时候提示如下:
实时错误'-2147217900 (80040e14)':
第一行:',' 附近有语法错误。
调试的时候这行是黄色的:Set objRs = MyConnection.Execute("Exec XSTS_Search" & str)