hi all.
im using this code for displaying data in Data Grid
please tell me is it neccesary to use SQL statement for displaying data in Data Grid.Code:Public Sub LoadData() Dim database_file As String database_file = App.Path & "\db1.mdb" Adodc1.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & database_file & ";" Adodc1.RecordSource = "SELECT * FROM table1" Set DataGrid1.DataSource = Adodc1 DataGrid1.Caption = "View Data" End Sub
Can i Display the data in the data grid using code below?
if yes please tell me what line i have to add into this codeCode:Set Cn = New ADODB.Connection Cn.Provider = "Microsoft.Jet.OLEDB.4.0" Cn.ConnectionString = App.Path & "\db1.mdb" Cn.Open Set Rs = New ADODB.Recordset Rs.Open "Table1", Cn, adOpenDynamic, adLockOptimistic, adCmdTable





Reply With Quote