vbmysql插⼊记录_VB中使⽤ADO代码向Access数据库添加记
录学步园
代码如下:
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
access转mysql教程视频Sql = "insert into admin(aid,psw,realname)values('" & Text1.Text & " ','" & Text2.Text & " ','" & Text3.Text & "')"
Conn.Execute Sql
Conn.Close
End Sub
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论