472,122 Members | 1,576 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

.asp

hey guys

I am working on thr professors website. In the website, when you fill in the author's name it retrieves information.

So if the authors name is J. smith, then if I write Smith, J. then it gets the information since it stored in the database in this format. But if I type in J. Smith it does not get any information.

I need to write this code in the .asp file where the scripting language in VBScript. So if anyone of you can help me out with this, i would reall appreciate it. Any form of help is appreciated.

Thanks guys

Kapil
Apr 3 '07 #1
2 1008
jhardman
3,406 Expert 2GB
You could handle it in the query statement:
Expand|Select|Wrap|Line Numbers
  1. names = split(nameEntered, " ")
  2. query = "SELECT * FROM authors WHERE authorName = '" & names(0) &_
  3.      ", " & names(1) & "' OR authorName = '" & names(1) & ", " & names(0)_
  4.     & "'"
  5. response.write "<!-- query: " & query & " -->" & vbNewLine
  6.  
let me know if this helps. Or you could use instr to see if the user used a comma.

Jared
Apr 3 '07 #2
You could handle it in the query statement:
Expand|Select|Wrap|Line Numbers
  1. names = split(nameEntered, " ")
  2. query = "SELECT * FROM authors WHERE authorName = '" & names(0) &_
  3.      ", " & names(1) & "' OR authorName = '" & names(1) & ", " & names(0)_
  4.     & "'"
  5. response.write "<!-- query: " & query & " -->" & vbNewLine
  6.  
let me know if this helps. Or you could use instr to see if the user used a comma.

Jared
Hey it did work Thanks a lot.
Apr 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.