Listbox

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Listbox

 
0
  #1
Jul 27th, 2006
greetings

i'm currently working on my Form in VB6. it has a list box that i use to display table. How do i display table from a different database?

i did it before by modifying row source property in VBA, but that only works if the form is part of that database application.

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. WaferSortRowSource = "SELECT [ABP/FET Wafer Sort].[D/C], [ABP/FET Wafer Sort].[P/N]," & _
  2. "[ABP/FET Wafer Sort].Process," & _
  3. " [ABP/FET Wafer Sort].[" & ColumnNo(1) & _
  4. "], [ABP/FET Wafer Sort].[" & ColumnNo(2) & _
  5. "], [ABP/FET Wafer Sort].[" & ColumnNo(3) & _
  6. "], [ABP/FET Wafer Sort].[" & ColumnNo(4) & _
  7. "], [ABP/FET Wafer Sort].[" & ColumnNo(5) & _
  8. "] FROM [ABP/FET Wafer Sort] ; "
  9.  
  10. WaferSort.RowSource = WaferSortRowSource

but now i want to use a ListBox in a VB6 application instead, which i tried but the listbox remained empty.

this function i use in my VB6 program to open the VBA database application

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Function OpenConnection()
  2. conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
  3. "//agmlhkhoo/NewFolder/cobaan.mdb;Mode=Read|Write"
  4. conConnection.CursorLocation = adUseClient
  5. conConnection.Open
  6. End Function

with this i can read the values that reside in the tables. but how do i display the tables in the form of listbox instead? what should i put in RowSource property of the listbox?

thanks in advance
Last edited by BombAppetit; Jul 27th, 2006 at 12:10 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Listbox

 
0
  #2
Jul 27th, 2006
I think a listbox is a bit more difficult to work with.... If I'm not mistaken, you'll have to do it all manually, such as using the "additem" property of the listbox..... you can use the sendmessage API call to force the listbox to use columns and keep the data orderly, but I think a listview would suite your needs better.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC