请问为什么我用mshflexgrid控件删除某一行之后再点查询 删的那一行又回来了??
Private Sub Command1_Click()'连接数据库
If conn.State = 0 Then
conn.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
App.Path & "\设计计算.mdb;Persist Security Info=False" '连接数据库的驱动字符串并打开数据库
conn.Open
End If
'查询记录
Dim sql As String, s$
Set rs = New ADODB.Recordset '创建数据集对象的连接
sql = "select * from [设计计算]"
rs.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
Set MSHFlexGrid1.DataSource = rs
End Sub
Private Sub Command2_Click()
'连接数据库
If conn.State = 0 Then
conn.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
App.Path & "\设计计算.mdb;Persist Security Info=False" '连接数据库的驱动字符串并打开数据库
conn.Open
End If
'删除
Dim sql As String
Set rs = New ADODB.Recordset '创建数据集对象的连接
sql = "delete from [设计计算] where [管段编号]=' " & MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 0) & " ' " '删除指定行
rs.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
MSHFlexGrid1.RemoveItem MSHFlexGrid1.Row
MsgBox "删除成功!"
End Sub
请问为什么我删除某一行之后再点查询 删的那一行又回来了??