跪求啊~~~~~~~~~为什么删不掉
Private Sub DeleteTextCompany()
Call GetCompany
Dim gjstring As String
Dim c As Long
Dim rs1 As ADODB.Recordset
If TextCompany(0).Text = "" Then
MsgBox ("请选中删除内容!")
Else
gjstring = TextCompany(0)
gjstring = "select * from ?óòμD??¢ where ?óòμD??¢.ID=" & gjstring
rs1.CursorLocation = adUseClient
rs1.Open gjstring, m_Connection, adOpenDynamic, adLockOptimistic
If rs1.EOF = False Then
c = MsgBox("?úè·è?òaé?3y???????e£?", vbOKCancel, "é?3yìáê?D??¢")
If c = vbOK Then
rs1.Delete gjstring, m_Connection, adOpenDynamic, adLockOptimistic
rs1.Update
End If
End If
End If
End Sub
[解决办法]
MSDN
Example
The following code shows how to delete a record using the Delete method.
Dim rs
Set rs = CreateObject("adoce.recordset")
rs.Open "myTable", "", 1, 3
rs.MoveLast
'This statement deletes the current (last) record.
rs.Delete
'This statement moves the pointer to the
'first record in the recordset which removes
'the deleted record from the recordset.
rs.MoveFirst
rs.Update
rs.Close
Set rs = Nothing