CodePudding user response:
Dim the rs As the ADODB library youThe Function openconn ()
Set the conn=New ADODB. Connection
Conn. Open the Provider="Microsoft. Jet. The OLEDB. 4.0; Data Source=e: \ aqxc \ aqxc MDB
"End the Function
The Function closeconn ()
Conn. Close
End the Function
Private Sub Command1_Click ()
Call openconn
Set the rs=New ADODB. You
Rs. Open the "select * from czy", conn, adOpenKeyset, adLockOptimistic
Rs. AddNew
Rs (" operator ")=Text1. Text
Rs (" password ")=Text2. Text
Rs. Update
Rs. Close
Set the rs=Nothing
Call closeconn
MsgBox "add data succeed!"
Text1=""
Text2=""
End Sub
Private Sub Command2_Click ()
End
End Sub
Dim the rs As the ADODB library you
The Function openconn ()
Set the conn=New ADODB. Connection
Conn. Open the Provider="Microsoft. Jet. The OLEDB. 4.0; Data Source=e: \ aqxc \ aqxc MDB
"End the Function
The Function closeconn ()
Conn. Close
End the Function
Private Sub Command1_Click ()
Call openconn
Set the rs=New ADODB. You
Rs. Open the "select * from czy", conn, adOpenKeyset, adLockOptimistic
Rs. AddNew
Rs (" operator ")=Text1. Text
Rs (" password ")=Text2. Text
Rs. Update
Rs. Close
Set the rs=Nothing
Call closeconn
MsgBox "add data succeed!"
Text1=""
Text2=""
End Sub
I am using the ACCESS + EXECL
Just derived using vb to write a program