vb 对象Refresh的方法IAdodc 失败
PrivateSubForm_Load()Adodc1.ConnectionString=conn.ConnectionString&";password=111"Cal...
Private Sub Form_Load()
Adodc1.ConnectionString = conn.ConnectionString & ";password=111"
Call MakeCenter(Me)
End Sub
Private Sub QuerySell()
Dim rs_check As New ADODB.Recordset
Dim strsql As String
If allsell = False Then
strsql = "select*from goods where 商品名='" _
& frmShowsell.txtName.Text & "' and 型号='" & frmShowsell.txtType.Text & "'"
Else
strsql = "select from sell"
End If
rs_check.Open strsql, conn, adOpenKeyset, adLockPessimistic
Adodc1.RecordSource = strsql
Adodc1.Refresh
DataGrid1.ReBind
If rs_check.EOF = True Then
MsgBox "此型号商品没有销售!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
rs_check.Close
End Sub 展开
Adodc1.ConnectionString = conn.ConnectionString & ";password=111"
Call MakeCenter(Me)
End Sub
Private Sub QuerySell()
Dim rs_check As New ADODB.Recordset
Dim strsql As String
If allsell = False Then
strsql = "select*from goods where 商品名='" _
& frmShowsell.txtName.Text & "' and 型号='" & frmShowsell.txtType.Text & "'"
Else
strsql = "select from sell"
End If
rs_check.Open strsql, conn, adOpenKeyset, adLockPessimistic
Adodc1.RecordSource = strsql
Adodc1.Refresh
DataGrid1.ReBind
If rs_check.EOF = True Then
MsgBox "此型号商品没有销售!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
rs_check.Close
End Sub 展开
1个回答
展开全部
Adodc1.ConnectionString = conn.ConnectionString & ";password=111"
这样写验证的吗?用户名都没有
"select*from
写得这么紧凑,SQL会把他认为是一个词
这样写验证的吗?用户名都没有
"select*from
写得这么紧凑,SQL会把他认为是一个词
追问
用户名怎么加
追答
你老老实实这么写就好了:
Adodc1.ConnectionString="Driver={SQL Server};Server=192.168.1.2;UID=sa;PWD=123456789;DataBase=数据库名"
谁知道你那conn对象里装的是什么
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询