Private Sub Command1_Click()
On Error Resume Next
With Adodc1.Recordset
rs.MoveLast
rs.AddNew
讀者.Fields("學號") = InputBox("請輸入學號:", "錄入")
Text1.Text = Adodc1.Recordset.Fields("學號")
.Fields("姓名") = InputBox("請輸入姓名:", "錄入")
Text2.Text = Adodc1.Recordset.Fields("姓名")
.Fields("性別") = InputBox("請輸入性別:", "錄入")
Text3.Text = Adodc1.Recordset.Fields("性別")
.Fields("學院") = InputBox("請輸入學院:", "錄入")
Text4.Text = Adodc1.Recordset.Fields("學院")
.Fields("班級編號") = InputBox("請輸入借書證號:", "錄入")
Text5.Text = Adodc1.Recordset.Fields("借書證號")
.Fields("政治面貌") = InputBox("請輸入聯系方式:", "錄入")
Text6.Text = Adodc1.Recordset.Fields("聯系方式")
.Fields("出生日期") = InputBox("請輸入借書數目:", "錄入")
Text7.Text = Adodc1.Recordset.Fields("借書數目")
rs.MoveLast
rs.Update
Adodc1.Refresh
End With
End Sub
程式可以運行,但是老是無法添加資訊,請指教
uj5u.com熱心網友回復:
你這代碼怪,沒給出rs的定義uj5u.com熱心網友回復:
rs.Update(...)這樣作或者直接db.execute(insert ...)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/131272.html
標籤:VB基礎類
