with datagrid1 .allowaddnew = True .allowupdate = True .allowdelete = True end with
datagrid怎么还是不能输入阿?》
工程--->引用--->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
.allowaddnew = True
.allowupdate = True
.allowdelete = True
end with
工程--->引用--->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
建议改用spread