Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 11th, 2008, 02:29 PM
Registered User
 
Join Date: Jan 2008
Location: Port Hardy, , Canada.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Several Data Connections for 1 Listbox???

I am creating a search option for my application...
I've constructed a form that allows the user to search the address book by Company Name, First/Last Name, or by Phone #. The results will be displayed in the address book form - either by list box or directly into the forms items... eg. labels,textboxes, etc.

Now obviously I can create one connection to the database based on my specific criteria and view the results in a listbox. I'd like to attempt to (using vb)... use the different connections based on the results of the search option... refer to psydo code below

assume:
-comboBox1 is Company Name
-comboBox2 is First/Last Name
-comboBox3 is Phone #
-Listbox1 DataConnection1, DataConnection2, DataConnection3

If comboBox1.indexChanged then
use DataConnection1 show results in Listbox1
end if

If comboBox2.indexChanged then
use DataConnection2 show results in Listbox1
end if

If comboBox2.indexChanged then
use DataConnection3 show results in Listbox1
end if

*****************************
Looking at that general logic I am struggling with how to call the different connections and how to show the results in Listbox 1.

Any suggestions would be appreciated... Thanks in advance.


LNickol
GIS Assistant
Gwa' sala - Nakwaxda Nation
Reply With Quote
  #2 (permalink)  
Old February 12th, 2008, 08:31 AM
Authorized User
Points: 222, Level: 4
Points: 222, Level: 4 Points: 222, Level: 4 Points: 222, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2007
Location: Phoenix, AZ, USA.
Posts: 48
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Halito LNickol,

Have you tried querying your database(s) giving a result set, and then ordering the set by the appropriate field:

ie:

Select fields from database1
Join on Database2 fields
Join on database3 fields
giving resultset.

Good luck

Tom
Reply With Quote
  #3 (permalink)  
Old February 12th, 2008, 08:33 AM
Authorized User
Points: 222, Level: 4
Points: 222, Level: 4 Points: 222, Level: 4 Points: 222, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2007
Location: Phoenix, AZ, USA.
Posts: 48
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi again,

use the Order By clause to order the result set.
Reply With Quote
  #4 (permalink)  
Old February 12th, 2008, 12:58 PM
Registered User
 
Join Date: Jan 2008
Location: Port Hardy, , Canada.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry my description maybe a little confusing...

I have 1 listbox. Based on the results of a search the listbox will display the data.
rather assume the following
Search By Options...
-comboBox1 is Company Name
-comboBox2 is First/Last Name
-comboBox3 is Phone #

Display Results...
-Listbox1 DataConnection1(Query - Company Name)
-Listbox1 DataConnection2(Query - First/Last Name)
-Listbox1 DataConnection3(Query - Phone #'s)

I hope that is a bit clearer! Thanks for taking the time, I appreciate it.



LNickol
GIS Assistant
Gwa' sala - Nakwaxda Nation
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing "data connections" jerryham VB.NET 3 September 25th, 2008 11:09 AM
Row data in listbox? DrConners Access VBA 1 June 8th, 2007 02:20 PM
Problem with Data Connections NuB BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 March 15th, 2006 08:52 PM
Listbox and put the data in acces 2003 BramuS ASP.NET 1.0 and 1.1 Basics 0 May 12th, 2005 02:39 AM
populating data into listbox adn datagrid madhava_ram Flash (all versions) 1 February 25th, 2005 11:46 PM



All times are GMT -4. The time now is 04:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.