|
-
September 26th, 1999, 01:05 AM
#1
Searching for record
I'm working on a project that requires searching of a record in a database table. This is to be done using SQL, "select * from table where criteria = (user_input)". Is this possible, or are there any alternatives?
-
September 26th, 1999, 04:26 AM
#2
Re: Searching for record
Lynn,
"Select *..... Where user input" is a good method to use.
Only thing is - be careful while making the SQL string. The "'" sign should be used where you search for string, you can use the * and like keywords if want to search the string within a string.
I just give a small example
Lets us say in text1 control user typed the word "san". Now you wish to search the word in a string field called Xname then the search will be
mySql = "Select * from mydb where Xname like *" & trim(text1.text) & "*'"
'to find the exact text
mySql = "Select * from mydb where Xname = '" & trim(text1.text) & "'"
regards,
Santulan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|