请教给位大牛!!! Public Function CSH(ByVal a As String, ByVal picture As PictureBox)
Dim cnn As ADODB.Connection Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider=MSDASQL.1;Password=yilijun;Persist Security Info=True;User ID=sa;Data Source=yanzheng;Mode=ReadWrite;Initial Catalog=码头管理信息系统" cnn.CursorLocation = adUseClient cnn.Open
Dim str1 As String Dim str As String Dim PC As PictureBox
str1 = a Set PC = picture
'查询 Dim cmd As New ADODB.Command Dim rs As New ADODB.Recordset Set cmd.ActiveConnection = cnn
cmd.CommandText = "Select 堆场位置 from 内卡位置1 where 内卡号='" & str1 & "'" 'cmd.CommandText = "Select 堆场位置 from 内卡位置1 where 内卡号 = 'N001'" cmd.CommandType = adCmdText
Set rs = cmd.Execute If rs.RecordCount = 0 Then 'If IsNull(rs.Fields) = False Then str = "" Else
str = rs.Fields("堆场位置") End If End Function 问题: 我调用:CSH "N001",picture1 在函数CSH中,值N001能够传到str1,并能够传到下面的蓝色的查询语句中,但是它就是不执行查询动作(蓝色语句) 但是如果直接采用红色语句的话就能够查询,并使得rs.recordcount=1 请问是什么问题