Data grid control

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 2
Reputation: VINOD_2553 is an unknown quantity at this point 
Solved Threads: 0
VINOD_2553 VINOD_2553 is offline Offline
Newbie Poster

Data grid control

 
0
  #1
Oct 28th, 2009
Hi i am working on a sotre inventry project.
I just want to fill grid from my ms accsess data base but
i can not understand what i can do
please help me in deeply
it is very urgent
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 837
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 153
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark
 
0
  #2
Oct 28th, 2009
Conver database to access97 and use the data form wizard, which you can find under Add-ins>Add-In Manager. I would suggest that you run the wizard for each type of form and with each type of data access and save this project for future reference.



Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 472
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #3
Oct 29th, 2009
plz see it. here the flexgrid will connect with data control by properties>data source.
Attached Files
File Type: zip data grid.zip (10.3 KB, 7 views)
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 253
Reputation: AndreRet is an unknown quantity at this point 
Solved Threads: 36
AndreRet AndreRet is offline Offline
Posting Whiz in Training
 
0
  #4
Oct 31st, 2009
Firstly select MS Datagrid from components. Add the grid to your form and the use the following code -

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private WithEvents cnGrid As ADODB.Connection
  2. Private WithEvents rsGrid As ADODB.Recordset
  3.  
  4. 'In your command button etc. click event add the following
  5.  
  6. Set rsGrid = New ADODB.Recordset
  7. rsGrid.Open "SELECT * FROM YourTableName ORDER BY YourFieldNameYouWantListedBy", cnGrid, adOpenStatic, adLockOptimistic
  8.  
  9. If rsGrid.BOF = True Then
  10. MsgBox "No report to view.", vbOKOnly + vbInformation, "No Report Available"
  11.  
  12. Exit Sub
  13. ElseIf rsGrid.EOF = True Then
  14. MsgBox "No report to view.", vbOKOnly + vbInformation, "No Report Available"
  15.  
  16. Exit Sub
  17. Else
  18.  
  19. Set YourDataGridName.DataSource = rsGrid
  20.  
  21. 'Set the coloumn width and headings here....
  22. rsGrid.Columns(0).Width = 1750
  23. rsGrid.Columns(1).Width = 3550
  24. rsGrid.Columns(2).Width = 2150
  25.  
  26. rsGrid.Columns(0).Caption = "FirstHeadingName"
  27. rsGrid.Columns(1).Caption = "SeconfHeadingName"
  28. rsGrid.Columns(2).Caption = "ThirdHeadingName"
  29.  
  30. End If

I hope this solves your problem.
Please mark questions as answered when done.

Be the ONE!!!
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC