954,558 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Listbox

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.

WaferSortRowSource = "SELECT [ABP/FET Wafer Sort].[D/C], [ABP/FET Wafer Sort].[P/N]," & _
                        "[ABP/FET Wafer Sort].Process," & _
                        " [ABP/FET Wafer Sort].[" & ColumnNo(1) & _
                        "], [ABP/FET Wafer Sort].[" & ColumnNo(2) & _
                        "], [ABP/FET Wafer Sort].[" & ColumnNo(3) & _
                        "], [ABP/FET Wafer Sort].[" & ColumnNo(4) & _
                        "], [ABP/FET Wafer Sort].[" & ColumnNo(5) & _
                        "] FROM [ABP/FET Wafer Sort] ; "
 
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

Function OpenConnection()
conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
                  "//agmlhkhoo/NewFolder/cobaan.mdb;Mode=Read|Write"
conConnection.CursorLocation = adUseClient
conConnection.Open
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

BombAppetit
Light Poster
29 posts since Jun 2006
Reputation Points: 16
Solved Threads: 0
 

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.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You