冰天雪地跪求VB高手..
为什么运行到Adodc1.Refresh 这里就提示出错了...整体程序如下:
-------
Private Sub Combo1_Click()
Dim str1 As String, str2 As String
str1 = Combo1.Text
str2 = Combo2.Text
Adodc1.ConnectionString = "Provider=SQLOLEDB;User ID=sa;pwd=sa;datasource=(local);Initial Catalog=宣城供电局"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
If str1 = "" And str2 <> "" Then
Adodc1.RecordSource = "select * from IS_VIEW where 设备名称='" & str2 & "'"
ElseIf str2 = "" And str1 <> "" Then
Adodc1.RecordSource = "select * from IS_VIEW where 变电所='" & str1 & "' "
Else
Adodc1.RecordSource = "select * from IS_VIEW where 变电所='" & str1 & "' and 设备名称='" & str2 & "'"
End If
Adodc1.Refresh
End Sub
期末作业啊....55~ 无只学了2天就放弃了。。。这个。。。寒。。
页:
[1]