Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
| 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 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
 
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

 
Old January 11th, 2006, 03:41 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
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

 
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.
 
Old January 12th, 2006, 12:10 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
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.








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





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