直接用ADO吧
Dim cn1 As ADODB.Connection
Dim rc1 As ADODB.Recordset
Dim strcn As String
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VB98\新食物成份表.mdb;Persist Security Info=False"
Set cn1 = New ADODB.Connection
Set rc1 = New ADODB.Recordset
cn1.Open strcn
rc1.CursorType = adOpenKeyset
rc1.LockType = adLockOptimistic
rc1.Open "新食物成份表", cn1, , , adCmdTable
rc1.AddNew
... ...
rc1.Update
rc1.Close
cn1.Close
Dim cn1 As ADODB.Connection
Dim rc1 As ADODB.Recordset
Dim strcn As String
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VB98\新食物成份表.mdb;Persist Security Info=False"
Set cn1 = New ADODB.Connection
Set rc1 = New ADODB.Recordset
cn1.Open strcn
rc1.CursorType = adOpenKeyset
rc1.LockType = adLockOptimistic
rc1.Open "新食物成份表", cn1, , , adCmdTable
rc1.AddNew
... ...
rc1.Update
rc1.Close
cn1.Close
不过我现在都是用ADO或者是直接调用系统的存储过程
界面上放置用户输入控件,不要绑定数据库,然后在Command1_Click里添加代码,Dim cn1 As ADODB.Connection
Dim rc1 As ADODB.Recordset
Dim strcn As String
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VB98\新食物成份表.mdb;Persist Security Info=False"
Set cn1 = New ADODB.Connection
Set rc1 = New ADODB.Recordset
cn1.Open strcn
rc1.CursorType = adOpenKeyset
rc1.LockType = adLockOptimistic
rc1.Open "新食物成份表", cn1, , , adCmdTable
rc1.AddNew
rc1!字段1=TEXT1.TEXT
... ...
rc1.Update
rc1.Close
cn1.Close