navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

using SQL like command in ASP

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> using SQL like command in ASP
Page: [1]
 
Guest


 
using SQL like command in ASP - 8/21/2001 20:43:00   
Let me firstly reiterate the comments of IWpunk and state that this forum definitely rocks. I had difficulty in running FP98 and PWS4.0. It now works thanks to Spooky.

Being able to play and experiment with FP98 and databases for the last few days has been great. However, there is another sticking point which I would be grateful if anyone could advise me on. The following code is from an ASP response page for a simple database storing details of books:
_____________________________________________

varAuthor= request.form("Author")

dim ORSp
Set oRSp=server.createobject("ADODB.recordset")
sqltext="Select * from Main "
sqltext=sqltext& " WHERE Author='" & varAuthor & "';"
oRSp.open sqltext, "dsn=bookpost"
_____________________________________________

It works well. However, I now want to be able for the search to return authors of books which are LIKE a certain author e.g. Twain. I know I can do this using SQL in access with the aid of LIKE and * * or ? ?. But how can I integrate the LIKE function in SQL into the following line which is taken from above?

sqltext=sqltext& " WHERE Author='" & varAuthor & "';"

I would be most appreciative of anyones help in this matter?

Many thanks

Spacker

Mojo

 

Posts: 2431
From: Chicago
Status: offline

 
RE: using SQL like command in ASP - 8/21/2001 13:32:00   
This should work:

sqltext=sqltext& " WHERE Author LIKE '%" & varAuthor & "%'"


Joe


(in reply to Guest)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> using SQL like command in ASP
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts