Private Sub CommandButton2_Click()
If TextBox2.Text <> "" And TextBox3.Text <> "" Then
Dim cn As New ADODB.Connection
Const constr = "provider=MSDAORA.oracle;data source=AAA;user id =AAA;password=AAA;"
cn.Open constr
cn.Execute
"insert into vba (a,b) values ("& textbox2.Text & "," & textbox3.Text & ")"
MsgBox "insert ok"
cn.Close
cn = Nothing
End If
End Sub
|