Home > Software engineering >  VB beginner questions about OLE insert excel for help
VB beginner questions about OLE insert excel for help

Time:10-11

I am a novice VB, want to build a table by VB, which can dynamically add rows and columns, it want to also have no thought of what good method, decided to use the method of insert OLE EXCEL input for a similar form, is there any familiar with OLE VB great god to teach the younger brother, Q964467376, in this first thank you very much ~

CodePudding user response:

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

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
  • Related