PDA

Click to See Complete Forum and Search --> : Searching and using databases (HELP!)


Ray.T
Nov 23rd, 2000, 11:52 AM
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"!!

Probe
Nov 23rd, 2000, 05:49 PM
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?

UBC_Wiskatos
Nov 23rd, 2000, 06:11 PM
I use SQL... Just do

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

Ray.T
Nov 24th, 2000, 04:00 AM
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.

Ray.T
Nov 24th, 2000, 04:02 AM
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.