Results 1 to 9 of 9

Thread: help! want to use something other than default data controls

  1. #1
    Guest
    I'm fairly new to VB, and I was wondering how to use an object other than the default data controls to sort through a database. In other words, I would like to be able to make the "Data" object invisible, and use a drop down list to sort through a particular column, thus changing which row is active (so it would change the other things on the form that are affected by changing which row of the Db is active).

    Thanks for any help,
    Mr.T3

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Since you are new to VB (and therefore probably new to ADO), start here:

    http://msdn.microsoft.com/library/ps...k/mdat3n3g.htm

  3. #3
    Guest

    ACK!

    I appreciate the info, but I'm too busy (and lazy) to learn a bunch of new things right now. Could you just explain how I could do what I need? I have a huge book on VB, but it doesn't explain how to do this, or if it does, I can't find it . Most of the tutorials and books I've found give really round-about complicated ways of explaining simple things. I was just looking for a real-life explanation for someone who ISN'T a VB pro.

    Mr.T3

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I suppose since you are really lazy, you could set the Visible property of the data control to FALSE, and not have to learn a single thing.....

    If you come across a way that I can learn without putting in any effort, PLEASE let me know, because I've been doing it wrong this whole time!

  5. #5
    Guest
    I knew how to make something invisible, but I'd like to know how to use a different object to control the database besides the default data-control without reading a 500 page manual (which I have).

    Thanks,
    Mr.T3

  6. #6
    Guest

    Sorry

    I'm sorry if I've been a little rude about any suggestions that have been made. I do have the resources to learn VB extensively, and realize that you people would appreciate us being able to learn on our own, but I lack the time to do so. I would like to be able to more fully understand the language and program, but I have my schoolwork among other things that are higher on my agenda. Again, I thank all of you for any suggestions, and resources you have pointed me to, but I would really just like to know how to do a few specific things at the present time. Perhaps I can learn how to use the language more efficiently in the near future, but I would just like to be able to complete this simple project with the time I have at hand.

    Thanks again,
    Mr.T3

  7. #7
    Guest
    If you dont want to use a data control object then you have to use SQL statements most notable the SELECT heres an example

    Dim db As Database
    Dim rs As Recordset
    'open database
    Set db = DBEngine.OpenDatabase("NWind2k.mdb")


    'open recordset using SQL LIKE
    Set rs = db.OpenRecordset("Select * from Customers where CustomerID like '*" & text1.text & "*'")


    'add all results to listbox
    Do Until rs.EOF = True
    List1.AddItem rs.Fields("CustomerID").Value
    rs.MoveNext
    Loop


    'close db/rs
    rs.Close
    db.Close
    Set rs = Nothing
    Set db = Nothing


    I found this in another thread. Learning SQL is not a simple thing.

  8. #8
    Guest

    Unhappy ouch!

    Wow! My brain hurts now! This could take longer than I expected.

    Mr.T3

  9. #9
    Guest
    It Really isn't all that complicated... Check out this 4 page article... it has nice simple examples... and a reference to the microsoft SQL references to find what you need... I just started working on a database a week ago and this little article has gotten me over the main parts

    http://vbsquare.com/databases/begado/index.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width