Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Display Data From DB To List Box?


Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2004, 12:45 PM
jkserial jkserial is offline
Newcomer
 
Join Date: Dec 2004
Posts: 4
Unhappy Display Data From DB To List Box?


What I am doing is using a query to get specific data from the db and then have the first and last names (each are seperate fields in db) display in the list box. I do not know how to go about doing this, please help?
Reply With Quote
  #2  
Old 12-24-2004, 02:19 AM
TopCat's Avatar
TopCat TopCat is offline
Regular
 
Join Date: Oct 2004
Location: Liverpool, England
Posts: 81
Default

Have a look at my replie for Jonathan_Bs post 'Searching' this should answer all of your questions
Reply With Quote
  #3  
Old 12-26-2004, 09:31 AM
Zero Ice Zero Ice is offline
Newcomer
 
Join Date: Nov 2004
Posts: 13
Default

Quote:
Originally Posted by jkserial
What I am doing is using a query to get specific data from the db and then have the first and last names (each are seperate fields in db) display in the list box. I do not know how to go about doing this, please help?
I assume you got RC as your recordset variable ( ADO Version )
Code:
Function GET_REC(ByVal Table_Name$,ByVal s_Criteria$,ByVal sIndx$) RC.Open "SELECT * FROM [" & Table_Name & "] WHERE [" & sIndx & "]='" & s_Criteria & "'" If Not RC.EOF Then '// we found the target '// fill up the listbox List1.Additem RC!First_Name & VbTab & RC!Last_Name End If Set RC = Nothing '// Nill '//Using Code : GET_REC "Table1",txtSearch,"Primary Key Of Yours" End Function

Happy coding, bye . . .

Last edited by Zero Ice; 12-26-2004 at 09:41 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->