[求助]数据更新时出现的问题
这段程序是在TABLE1表里满足列A=TEXT3。TEXT和列B=b1时用B=b2代替B=b1的代码,但实现不了结果,
如果把a=mrc.fields(1).value a=”100“ (即mrc.fields(1).value 里的值是数字)则可以实现修改,但把mrc.fields(2).value的值改为数字也不能实现,请高手帮帮看看是什么问题,并修改下谢谢
Private Sub Command5_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Dim a As String '定义个字符串
txtSQL = "select * from table1 where A ='" + Trim(Text3.Text) + "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
a = mrc.Fields(2).Value
If a = "b1" Then
txtSQL = "update table1 set B = 'b2' where A = '" + Trim(Text3.Text) + "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
End If
End Sub
[此贴子已经被作者于2006-5-26 19:38:47编辑过]