RSS Forums RSS
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 13849 | Replies: 2
Reply
Join Date: Feb 2005
Posts: 11
Reputation: nelly_1005 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nelly_1005 nelly_1005 is offline Offline
Newbie Poster

Help SQL statement to query user input??

  #1  
Mar 14th, 2005
Hi GUys

Just wondering if any one can help me out. Basically i wnat to create an SQL query which will take the input of the user and query that specific variable:

e.g the user enetrs in a field, the value entered is assigned to variable "srch", then in my SQL query i want whatever has been entered to be pattern matched to the data stored in the database, would the query possibale be something like this:

SELECT functionme FROM MsgeTble WHERE alternme LIKE "*$srch*"

Im pretty novice in databases

Please any suggestions would be grateful! Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Posts: 1
Reputation: HMC1991 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
HMC1991 HMC1991 is offline Offline
Newbie Poster

Re: SQL statement to query user input??

  #2  
Jun 27th, 2006
Hey ppl,

I also have the same problem, but I usually dont have as much time to log on here. If anybody does have the answer, plz email me at husseinmohamedali@gmail.com. Thanks
Reply With Quote  
Join Date: Mar 2007
Posts: 4
Reputation: Rupeshba is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Rupeshba Rupeshba is offline Offline
Newbie Poster

Solution Re: SQL statement to query user input??

  #3  
Mar 31st, 2007
Originally Posted by nelly_1005 View Post
Hi GUys

Just wondering if any one can help me out. Basically i wnat to create an SQL query which will take the input of the user and query that specific variable:

e.g the user enetrs in a field, the value entered is assigned to variable "srch", then in my SQL query i want whatever has been entered to be pattern matched to the data stored in the database, would the query possibale be something like this:

SELECT functionme FROM MsgeTble WHERE alternme LIKE "*$srch*"

Im pretty novice in databases

Please any suggestions would be grateful! Thanks





HI...

There is 2 ways.
i) u can write in the Qurey
just u have to enter in the last field like this : [Enter the Name]
and in Criteria: u have the write the filed name
like:
[Enter the Name]
Field Name

ii) u can write in the code
set db = currentdb
set rec = db.oprecordset("Select * from MsgeTble WHERE ename = " & text1.value & "")

if not(rec.bof and rec.eof) then
rec.movefirst
while not rec.eof
text1.value = rec.field("aaa")
rec.movenext
wend
end if


*********************

kindly try this if not work than reply me...

Bye...
Rupesh
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:32 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC