|
You try it, easy to use, dynamically change the data in datagrid
Remember to quote ado
You only need to include miscrosoft Activex data objects 2.x library in the project/reference
Dim Db As Connection
Dim WithEvents adoPrimaryRS As Recordset'database connection object
Private Sub Command1_Click()
strsql="select field from table where your condition"
Set Db = New Connection
Db.CursorLocation = adUseClient
'You need to modify the following connection data string
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&App.Path&"\plan management system.mdb;Persist Security Info=False"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open strsql, Db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoPrimaryRS
end sub |
|