
- UID
- 283518
- 帖子
- 1198
- 精华
- 0
- 威望
- 0
- 阅读权限
- 100
- 注册时间
- 2005-5-4
|
冰天雪地跪求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~ |
|