hi all.
im using this code 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
please tell me is it neccesary to use SQL statement for displaying data in Data Grid.
Can i Display the data in the data grid using code below?
Code:
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
if yes please tell me what line i have to add into this code
this works now my question is in the data grid i can see the Fields name same as in my table. can i change them? so the user will know what is the Real meaning of the field. im uploading my simple example please help me this is very urgent
now please tell me how can i jump to a particular Row in data grid im using this code but it does not jump back to the rows (UP SIDE) which are hidden by scrolling the data grid
Code:
Private Sub Command6_Click()
On Error Resume Next
Do While DataGrid1.SelBookmarks.Count > 0
DataGrid1.SelBookmarks.Remove 0
Loop
DataGrid1.Row = Val(Text4.Text)
DataGrid1.Col = 0
DataGrid1.SelBookmarks.Add Adodc1.Recordset.Bookmark
End Sub
please fix this with the uploaded example of me. please
thank you west4dbt,
i think you are right, i don't need to jump on a particular record. i can use SQL commands for this and this will be enough to work with it.
do you have something to tell me? about data grid or what else i can do with it or what you want me to do with it?
I don't know what your trying to accomplish so I can't suggest how to use the grid. I would suggest that you use an ADO recordset instead of an ADODC control for the DataSource, it will be more flexable.