工程--->引用--->Microsoft ActiveX Data Object 2.x(版本号) Dim CN As New ADODB.Connection '定义数据库的连接 Dim Rs As New ADODB.Recordset CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\NWIND.MDB;Persist Security Info=False" CN.Open Rs.CursorLocation = adUseClient Rs.Open "select * from employees", CN, adOpenDynamic, adLockBatchOptimistic Set DataGrid1.DataSource = Rs
接着[lihonggen0(李洪根,用.NET,标准答案来了)] CN.BeginTrans CN.Execute "delete from employees where ..." CN.CommitTrans
Dim CN As New ADODB.Connection '定义数据库的连接
Dim Rs As New ADODB.Recordset CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\NWIND.MDB;Persist Security Info=False"
CN.Open Rs.CursorLocation = adUseClient
Rs.Open "select * from employees", CN, adOpenDynamic, adLockBatchOptimistic Set DataGrid1.DataSource = Rs
CN.Execute "delete from employees where ..."
CN.CommitTrans
好像每台计算机内都有哦