VBA 获取数据库内容

    技术2025-12-16  8

    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   

    最新回复(0)