或者各位有什么好的建议,怎么实现??具体一点,有代码最好了,谢谢
举个ç®åçä¾åï¼
ä¾å¦ä½ å¨çé¢ä¸æ¾ç½®äº5个textææ¬æ¡ï¼å®ä»¬åå«æ¯ï¼å§åãå¹´é¾ãæ§å«ãä½åãå·¥ä½åä½ï¼é£ä¹å¨æ°æ®åºçä¸ä¸ªè¡¨ä¸å¿ é¡»æä¸è¿°ç对åºçå段ï¼æ¯å¦æ°æ®åºæ¯a.mdbï¼å¨è¿ä¸ªæ°æ®åºä¸çä¸ä¸ªè¡¨æ¯ab1表ï¼è¡¨ä¸æå§åãå¹´é¾ãæ§å«ãä½åãå·¥ä½åä½å段ã
å¨çé¢ä¸æ¾ç½®ä¸ä¸ªæé®ï¼å¨æé®çåå»äºä»¶ä¸æ·»å è®°å½ï¼
Dim db As New ADODB.Connection, RS As New ADODB.Recordset, strSQL As String
Private Sub Command1_Click()
db.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & App.Path & "\a.mdb"
db.Open
strSQL = "select * from ab1表 "
RS.Open strSQL, db, 3, 3
RS.AddNew
RS!å§å = Text1.Text
RS!å¹´é¾ = Text2.Text
RS!æ§å« = Text3.Text
RS!ä½å = Text4.Text
RS!å·¥ä½åä½ = Text5.Text
RS.Update
RS.Close
db.Close
End Sub
ä¾å¦ä½ å¨çé¢ä¸æ¾ç½®äº5个textææ¬æ¡ï¼å®ä»¬åå«æ¯ï¼å§åãå¹´é¾ãæ§å«ãä½åãå·¥ä½åä½ï¼é£ä¹å¨æ°æ®åºçä¸ä¸ªè¡¨ä¸å¿ é¡»æä¸è¿°ç对åºçå段ï¼æ¯å¦æ°æ®åºæ¯a.mdbï¼å¨è¿ä¸ªæ°æ®åºä¸çä¸ä¸ªè¡¨æ¯ab1表ï¼è¡¨ä¸æå§åãå¹´é¾ãæ§å«ãä½åãå·¥ä½åä½å段ã
å¨çé¢ä¸æ¾ç½®ä¸ä¸ªæé®ï¼å¨æé®çåå»äºä»¶ä¸æ·»å è®°å½ï¼
Dim db As New ADODB.Connection, RS As New ADODB.Recordset, strSQL As String
Private Sub Command1_Click()
db.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & App.Path & "\a.mdb"
db.Open
strSQL = "select * from ab1表 "
RS.Open strSQL, db, 3, 3
RS.AddNew
RS!å§å = Text1.Text
RS!å¹´é¾ = Text2.Text
RS!æ§å« = Text3.Text
RS!ä½å = Text4.Text
RS!å·¥ä½åä½ = Text5.Text
RS.Update
RS.Close
db.Close
End Sub
温馨提示:答案为网友推荐,仅供参考