944,008 Members | Top Members by Rank

Ad:
Oct 28th, 2009
0

Data grid control

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
VINOD_2553 is offline Offline
10 posts
since Oct 2009
Oct 28th, 2009
0
Re: Data grid control
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
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Oct 29th, 2009
0
Re: Data grid control
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, 24 views)
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Oct 31st, 2009
0
Re: Data grid control
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.
Reputation Points: 329
Solved Threads: 347
Senior Poster
AndreRet is offline Offline
3,700 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Checking if not a number help
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: creating lottery interface





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC