Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming
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.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 20th, 2008, 04:06 AM
gayatheri gayatheri is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 gayatheri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

regards
gayatheri

Reply With Quote
  #2  
Old May 20th, 2008, 05:51 AM
zynder's Avatar
zynder zynder is offline
Not much of a contributor
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2006
Location: Hidden
Posts: 1,009 zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)  Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 5 Days 8 h 20 m 17 sec
Reputation Power: 1089
Send a message via Yahoo to zynder
Facebook
i suggest you stay away with bound controls like datagrid. Use other alternative like listview or flexgrid. Trust me with this, datagrids are evil.

Reply With Quote
  #3  
Old May 20th, 2008, 09:05 PM
gayatheri gayatheri is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 gayatheri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 34 sec
Reputation Power: 0
but it a requirement to use the datagrid..

hmm could u suggest how to use the msflexgrid align with the problem i stated above??

Reply With Quote
  #4  
Old May 20th, 2008, 09:16 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: 94610
Posts: 14,743 medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)medialint User rank is General 107th Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 1 Week 3 Days 16 h 11 m 51 sec
Reputation Power: 8129
Facebook
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 ...
__________________
medialint.com


“Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

Last edited by medialint : May 20th, 2008 at 09:24 PM.

Reply With Quote
  #5  
Old May 21st, 2008, 06:43 PM
zynder's Avatar
zynder zynder is offline
Not much of a contributor
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2006
Location: Hidden
Posts: 1,009 zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)zynder User rank is General 2nd Grade (Above 100000 Reputation Level)  Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1Folding Points: 201535 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 5 Days 8 h 20 m 17 sec
Reputation Power: 1089
Send a message via Yahoo to zynder
Facebook
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Datagrid and datacombo linking


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap