回复 2楼 alike
Private Sub Command5_Click(Index As Integer)
Dim cn As New ADODB.Connection
Dim rss As New ADODB.Recordset
rss.CursorLocation = adUseClient
ConnectionString = "Provider=SQLOLEDB.1;Password=1234;Persist Security Info=True;User ID=sa;Initial Catalog=csjxcglxt;Data Source=TANGJIANQIAO-PC"
cn.Open ConnectionString
If Text3.Text = "" Then
MsgBox "请填写关键词!", vbExclamation, "提示信息"
Exit Sub
End If
rss.Open "select * from 商品库存表 where
商品编号 = str(" & Text3.Text & ")", cn, adOpenKeyset, adLockOptimistic
If rs.RecordCount = 0 Then
MsgBox "没有这条记录!", vbExclamation, "提示信息"
End If
rss!商品库存量 = rss!商品库存量 + Val(" text4.text")
rss.Update
End Sub
Private Sub Form_Load()
Set cnn = New ADODB.Connection
cnn.CursorLocation = adUseClient
cnn.Open "Provider=SQLOLEDB.1;Password=1234;Persist Security Info=True;User ID=sa;Initial Catalog=csjxcglxt;Data Source=TANGJIANQIAO-PC"
Set rs = New ADODB.Recordset
Set rs.ActiveConnection = cnn
rs.Open "select * from 商品信息表", cnn, adOpenDynamic, adLockBatchOptimistic
Set cmm = New
Set cmm.ActiveConnection = cnn
End Sub
这是我的代码,不能实现功能,