代码如下:

Option Explicit
'工程->引用->勾选 Microsoft ActiveX Data Objects 2.X Library

Dim Conn As New ADODB.Connection
Dim conStr As String
Dim Sql As String

Private Sub Command1_Click()

    conStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & "book.mdb"
    Conn.Open conStr
   
    Sql = "insert into admin(aid,psw,realname)values('" & Text1.Text & " ','" & Text2.Text & " ','" & Text3.Text & "')"
    Conn.Execute Sql
   
    Conn.Close

End Sub

相关文章:

  • 2021-04-23
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-11
  • 2021-10-21
  • 2021-12-06
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
相关资源
相似解决方案