Discuss Datagrid and datacombo linking in the Visual Basic Programming forum on Dev Shed. Datagrid and datacombo linking Visual Basic Programming forum discussing VB specific programming information. Quickly prototype and build applications with this robust and simple language.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 2
Time spent in forums: 39 m 34 sec
Reputation Power: 0
Datagrid and datacombo linking
hi
im currently developing a system using visual basic 6.0 with the access database.
the wizard contains:-
1) datagrid
2) datacombo
3) command button
i manage to retrieve the data from accesss. and i manage to display the data selected from data combo to the datagrid but it display the whole data base content.
my problem now is, i want the datagrid to show data for only the selected item from the datacombo.
could u pls kindly help me out with this.thank u for ur kindness.
Posts: 14,743
Time spent in forums: 6 Months 1 Week 3 Days 16 h 11 m 51 sec
Reputation Power: 8129
Quote:
Originally Posted by zynder
i suggest you stay away with bound controls like datagrid. Use other alternative like listview or flexgrid. Trust me with this, datagrids are evil.
I disagree about data bound controls! I don't normally use datagrids specifically but I do use bound controls. Although if I'm using access I just do all the development in access. In this case all the controls can be data bound.
Data binding is very efficient for some interfaces with vast amounts of data, including data from disparate databases (local mdb joined with oracle, for example)
-- edit // mmm ... maybe I'm just bickering over semantics in the end ... "data binding". The datagrid in vb6 is admittedly pretty lacking ...
Posts: 1,009
Time spent in forums: 1 Week 5 Days 8 h 20 m 17 sec
Reputation Power: 1089
the problem with binding is the lack of flexibility especially with a datagrid control.
@media
Quote:
Data binding is very efficient for some interfaces with vast amounts of data, including data from disparate databases (local mdb joined with oracle, for example)
actually it depends on the approach. both can be efficient. when dealing with vast amounts of data, i usually use paging techniques when displaying the data.
@gayatheri
you can use msflexgrid.textmatrix (row,col) to populate data. just put your incrementing variable to row,col inside the loop.
if you are populating very large data at once, use paging techniques or .Clip property combine with recordset.getstring
sample:
Code:
Private Sub Command1_Click()
Screen.MousePointer = vbHourglass
Set rs = New ADODB.Recordset
strsearch = "SELECT * FROM TblName ORDER BY AnyField"
rs.Open strsearch, adoc, adOpenDynamic, adLockOptimistic
rs.Requery
If rs.RecordCount = 0 Then
MSFlexGrid1.Clear
MsgBox "No record found"
Screen.MousePointer = vbNormal
Exit Sub
ElseIf rs.RecordCount >= 1 Then
'populate flexgrid box
With MSFlexGrid1
.Clear
.Rows = rs.RecordCount + 1
.Cols = rs.Fields.Count - 1
.Row = 1
.Col = 0
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.Clip = UCase(rs.GetString(adClipString, -1, Chr(9), Chr(13), vbNullString))
.Row = 1
End With
End If
Screen.MousePointer = vbNormal
End Sub
In this case, the recordset is treated as string so no loop is needed when populating a flexgrid. Displaying large records from the database is extremely fast.