populating dbgrid
hello,
I am using DBGrid in my project.following is the code used to populate DBGrid with recordset.
'opening connection
Cn_path.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\dbHRMS.mdb" & "; Persist Security Info=true"
Cn_path.Open
'using recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "select * from Leave_OB, Cn_path, adOpenKeyset, , adAsyncFetchNonBlocking"
End With
Set DBGrid1.DataSource = rs
my problem is data is not getting displayed in the DBGrid1
thanks in advance
karuna
[702 byte] By [
btkaruna] at [2007-11-19 15:15:40]

# 2 Re: populating dbgrid
hello HanneSThEGreaT,
Thank you for immediate reply.
In the code i had used
Set dbgrid1.datasource=rs
but the records r not getting displayed in the DBGrid.
I Also tested sql query independently and its showing record.
thanks in advance
karuna
# 3 Re: populating dbgrid
Hello!
Well your SQL query in my opinion seems to be OK :confused:
I'm thinking that it might be how your DBGrid is set up, In Other Words, What properties have you set for the DBGrid
Can you perhaps include your zipped project
# 6 Re: populating dbgrid
hello,
Thank you for the project sent .One final question on this.Is it not possible to populate DBGrid without using data control i.e using only adodb connection and recordset(code that is posted).I need to make decision based on ur reply for our project as almost every form we would be using DBGrid.
Thanks a lot once again.
karuna
# 7 Re: populating dbgrid
hello,
Thank you for the project sent .One final question on this.Is it not possible to populate DBGrid without using data control i.e using only adodb connection and recordset(code that is posted).I need to make decision based on ur reply for our project as almost every form we would be using DBGrid.
Thanks a lot once again.
karuna
I can be wrong, but I don't think so.
You could of course make the ADODBControl or DataControl invisible, though..
Why not use the MSHFlexGrid instead of the DBGrid - it is Much more flexible