 |
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 11th, 2006, 03:22 PM
|
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
actually i did not add anything to that code exccept for the name of the variables
the rest was built by ms access
|
|

January 11th, 2006, 03:41 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

January 12th, 2006, 02:40 AM
|
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok, I'll do that.
thanx
|
|

January 12th, 2006, 07:43 AM
|
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

January 12th, 2006, 12:10 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

January 13th, 2006, 01:54 AM
|
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |