Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old January 11th, 2006, 03:22 PM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

actually i did not add anything to that code exccept for the name of the variables
the rest was built by ms access

Reply With Quote
  #12 (permalink)  
Old January 11th, 2006, 03:41 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Access is not ASP.

The query might run fine in Access, but for you to pass it to the Access database, it needs to be a valid string.

The recommendations about quotes etc is one piece of the puzzle to make this work from an ASP page.

You may need to read up a bit about ASP and Access in general. Once you understand concepts like string concatenation, you'll be able to build better sites quicker.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #13 (permalink)  
Old January 12th, 2006, 02:40 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I'll do that.
thanx

Reply With Quote
  #14 (permalink)  
Old January 12th, 2006, 07:43 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem was the that last part after where cluse.

it should be like this:
------------------------
WHERE (((tblBooks.Title) Like '%" & Replace(Recordset1__vtitle, "'", "''") & "%')) OR (((tblBooks.AuthorName) Like '%" & Replace(Recordset1__vauthorname, "'", "''") & "%'))"
------------------------

the idea of the string concatenation in some short e.gs
----------------------------------------------------------
you must use & to concatenate strings in VBScript

you want the sql to look similair to this

select * from table where field like '%something%'

so build it like this

Code:
something = "something"
sql = "select * from table where field like '%" & something &"%'"
and if you want it to look like this
select * from table where field like "%something%"
use "" like this

Code:
something = "something"
sql = "select * from table where field like ""%" & something & "%"""


Thanks to nofriends.
Reply With Quote
  #15 (permalink)  
Old January 12th, 2006, 12:10 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Yeah, that looks much better....

I am not sure if all databases support the double quote as a delimiter, so it's better to stick to the single quote.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #16 (permalink)  
Old January 13th, 2006, 01:54 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

quote][ so it's better to stick to the single quote.[/quote]


Yes,I'll try to work more on such e.g (sql statements) to know it better.
MANY THANKS to you too Imar, you are a great support.




Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me by giving code for this search button csateesh ASP.NET 1.0 and 1.1 Professional 1 August 7th, 2007 07:40 AM
Recordset Error Message Joemenator Classic ASP Databases 5 January 16th, 2007 04:47 AM
mysql_num_rows() => Giving Error? Cybot MySQL 4 September 12th, 2006 12:07 PM
This piece of code is giving an error sourik C# 2 July 15th, 2006 09:18 AM
advance search with stored procedure harpua Classic ASP Databases 1 December 29th, 2004 04:02 AM



All times are GMT -4. The time now is 08:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.