ado把文本框的东西保存到数据库中有办法吗?谢谢了,大神帮忙啊
展开全部
Public con As ADODB.Connection, Str As String, Ado As ADODB.Recordset, sql As String Public i As Integer, conn As String Public Sub ado_Open() Set con = New ADODB.Connection conn = "Access" If conn = "SQL" Then Str = "Driver={SQL SERVER};SERVER=192.168.1.168;Uid=SA;Pwd=;Database=tempdb" If conn = "Access" Then Str = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "\Finance.mdb;pwd=;ReadOnly=True" con.Open Str End Sub Public Sub Newado() Set ado = New ADODB.Recordset ado.CursorLocation = adUseClient ado.Open sql, con, adOpenDynamic, adLockBatchOptimistic End Sub Private Sub CommandButton1_Click() ado_open sql="select * from tmp" newado Ado.AddNew Ado.Fields(0) = text1 Ado.Fields(1) = text2 Ado.Fields(2) = text3 Ado.UpdateBatch End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询