Hi ! I am Hira.
I am learning how to use DataGrid control.
I want to show datas from MS Access table on the DataGrid.
But I could't do that.
Please give me some advices for resolving this problem.
I have confirmed I can connect my VB application with Access DB. My code is as bellow.
Private Sub Form_Load()
Dim MySql As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
On Error GoTo Err_Form_Load
cn.ConnectionString = "XXXXXX"
cn.Open
MySql = "SELECT MachineNumber FROM MachineData"
rs.Open MySql, cn, adOpenStatic, adLockOptimistic
Set dbgTrouble.DataSource = rs
Exit_Form_Load:
Exit Sub
Err_Form_Load:
MsgBox (Err.Number & Chr(13) & Err.Description)
End
End Sub
I am learning how to use DataGrid control.
I want to show datas from MS Access table on the DataGrid.
But I could't do that.
Please give me some advices for resolving this problem.
I have confirmed I can connect my VB application with Access DB. My code is as bellow.
Private Sub Form_Load()
Dim MySql As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
On Error GoTo Err_Form_Load
cn.ConnectionString = "XXXXXX"
cn.Open
MySql = "SELECT MachineNumber FROM MachineData"
rs.Open MySql, cn, adOpenStatic, adLockOptimistic
Set dbgTrouble.DataSource = rs
Exit_Form_Load:
Exit Sub
Err_Form_Load:
MsgBox (Err.Number & Chr(13) & Err.Description)
End
End Sub