[求助]关于系统开发里的一个问题,请指点
我对修改按钮的功能实现遇到了问题,贴图如下:其中text控件命名为:moditext
程序如下:
但是不能实现修改的功能,请指点:
If oppjdw.Value = True And Trim(moditext.Text) <> "" Then
Dim re_reader1 As New ADODB.Recordset
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim sql As String
sql = "select * from lydw where 领用单位='" & Trim(moditext.Text) & "'"
conn.ConnectionString = "dsn=pjb;uid=;pwd=;"
conn.Open
re_reader1.CursorLocation = adUseClient
re_reader1.Open sql, conn, 2, 2
If re_reader1.EOF Then
re_reader1.delect
re_reader1.AddNew
re_reader1.Fields(0) = Trim(moditext.Text)
re_reader1.Update
MsgBox "修改成功", vbOKOnly
dg1.Clear
dg1.Refresh
refreshdw
re_reader1.Close
conn.Close
End If