Visual Basic 6.0 Database

Discussion in 'Software' started by MBlock, Mar 21, 2005.

  1. MBlock

    MBlock Private E-2

    Hey guys, I am trying to familiarize myself with VB 6.0 and I am writing a simple application to access a Microsoft Access Database and display the "Name" field into a list box. Ultimatly I'd like to click on the name of say a Tool in the list box and then when I do that text boxes get filled in with attributes of that tool. (i.e. the data base has 3 columns name of tool, price, and how many in stock) then when the program loads I wanted all the names that were in the database to populate a listbox, then when you click on one of the names in the listbox I wanted the other two columns to show up in seperate respective text boxes.

    I cannot get the names to show up in the listbox :confused: . I am having a hard time linking the Access Database I made to the list box. I can link the database to individual text boxes just fine through the data control object. However, when I try to link the data control object to the listbox nothing happens. Can anyone please help me out with this. The main help I need is just getting the listbox to display all the names from the database and then anymore help past that would be appreciated greatly but not as important. THANKS ALOT!
     
  2. RHK-Commander959

    RHK-Commander959 Private E-2

    Well how do you connect to the access database? It would probably be easiest (programming-wise) to connect to the access database through an adodc connection. I forget that stuff, but i'll look it up later if you still need help
     
  3. MBlock

    MBlock Private E-2

    Well since posting I have figured out my problem.. I was trying to use a data control object and link that to the list box... but that only works for just text boxes and one field of the database (or so I believe) so code wise I just created a database variable, a recordset variable. Then set the database variable to the location of the database and the recordset variable to the current recordset and just looped while the recordset wasn't the EOF and loaded each one into the list box and it worked! So thanks for your offer to help I appreciate it!
     
  4. Kodo

    Kodo SNATCHSQUATCH

    If you want to speed things up , Try using getrows() to populate an array and loop through the array to populate instead. This will release db, connection resources in lieu of using faster memory to store the data.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds