| | |
Data grid control
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2009
Posts: 837
Reputation:
Solved Threads: 153
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
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
•
•
Join Date: Jan 2008
Posts: 253
Reputation:
Solved Threads: 36
0
#4 Oct 31st, 2009
Firstly select MS Datagrid from components. Add the grid to your form and the use the following code -
I hope this solves your problem.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private WithEvents cnGrid As ADODB.Connection Private WithEvents rsGrid As ADODB.Recordset 'In your command button etc. click event add the following Set rsGrid = New ADODB.Recordset rsGrid.Open "SELECT * FROM YourTableName ORDER BY YourFieldNameYouWantListedBy", cnGrid, adOpenStatic, adLockOptimistic If rsGrid.BOF = True Then MsgBox "No report to view.", vbOKOnly + vbInformation, "No Report Available" Exit Sub ElseIf rsGrid.EOF = True Then MsgBox "No report to view.", vbOKOnly + vbInformation, "No Report Available" Exit Sub Else Set YourDataGridName.DataSource = rsGrid 'Set the coloumn width and headings here.... rsGrid.Columns(0).Width = 1750 rsGrid.Columns(1).Width = 3550 rsGrid.Columns(2).Width = 2150 rsGrid.Columns(0).Caption = "FirstHeadingName" rsGrid.Columns(1).Caption = "SeconfHeadingName" rsGrid.Columns(2).Caption = "ThirdHeadingName" End If
I hope this solves your problem.
Please mark questions as answered when done.
Be the ONE!!!
Be the ONE!!!
![]() |
Similar Threads
- Showing an empty field in data grid for data entry (Visual Basic 4 / 5 / 6)
- data grid view (ASP.NET)
- Retrieve date from Calendar control inside a data grid (ASP)
- data grid (Visual Basic 4 / 5 / 6)
- control a data grid (Visual Basic 4 / 5 / 6)
- VB.Net 2008 errors with ADO Data control and Data Grid (VB.NET)
- Data Grid and Listbox (VB.NET)
- How to set decimal digits to 2 for a double type data field in grid control (Visual Basic 4 / 5 / 6)
- Data Grid in Win32 C (C++)
- Data Grid: How to include Hyperlinks (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Checking if not a number help
- Next Thread: creating lottery interface
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





