Results 1 to 5 of 5

Thread: Searching and using databases (HELP!)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    Cheshire, England
    Posts
    115
    Can any VB gurus out there PLEASE help me??

    I am desperatley trying to find out how to utilize a database in an application I am trying to develop.
    Basically all I need to do is assign 2 values from a .MDB database to 2 variables based on the input of a textbox (which is used as the search field in the database)there are 6 databases which I want to select from an option box for each. Each DB has three fields for each record,once the correct database has been selected, you enter the value for the search field in the text box, the database is searched for a match in the search field and the other 2 values are assigned to variables from the other 2 fields. This all goes on behind the scenes and the variables are then used in calculations.

    All I can find is references to creating,appending,sorting,and displaying DB info. Please help my poor soul or im going to end up in the "Big House"!!

  2. #2
    New Member
    Join Date
    Nov 2000
    Posts
    3

    Question

    I am unclear on what you are trying to search for. Are you looking for specific data within the selected database or are you trying to find the correct field within the database?

  3. #3
    Junior Member
    Join Date
    Nov 2000
    Posts
    23
    I use SQL... Just do

    SELECT * FROM tablename WHERE fieldname=' & fieldinput &'
    At least I think it goes like that :-) Hope that helps!

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    Cheshire, England
    Posts
    115
    Originally posted by Probe
    I am unclear on what you are trying to search for. Are you looking for specific data within the selected database or are you trying to find the correct field within the database?
    The database field that I need to search contains numbers and I need to enter the number in the textbox and the program then needs to find a match on this number in the database. when a match is FOUND() the other two fields in that record then need to be assigned to two variables. I am also unsure as to how to open the database (this needs IF statements because what database is selected depends on the state of 8 option boxes, there are 8 identically structured databases involved each with different data in the other two fields. The numbers in the searched field are identical in each DB) Does this make any sense!? Thank you so much for your reply and I hope you can help me (be warned I am a hopeless Newbie at VB (it seemed longer but so much easier in the old dBase systems, there now ive blown it!!) Thanks.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    Cheshire, England
    Posts
    115
    Originally posted by UBC_Wiskatos
    I use SQL... Just do

    SELECT * FROM tablename WHERE fieldname=' & fieldinput &'
    At least I think it goes like that :-) Hope that helps!
    Thanks for you reply. This seems to be the way to do it, I havent tried it out yet as I dont even know how to connect or open the database (hopeless!!) Cheers anyway.

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