|
 |
asp_databases thread: RE: LIKE
Message #1 by Bernadette Duffy <b.duffy@m...> on Thu, 24 Aug 2000 23:55:54 +0100
|
|
sqlQuery = "SELECT * FROM bernie"
sqlQuery = sqlQuery & " WHERE County LIKE '" & scounty & "' "
Can anyone tell me what is wrong with the above statement. The fields etc
are valid names. When I use = everything works fine. I seems to dislike this
LIKE command. Any ideas?
-----Original Message-----
From: Dave Sussman [mailto:davids@i...]
Sent: Thursday, August 24, 2000 1:05 PM
To: ASP+
Subject: [aspx] Re: problem with "A Preview of ASP+" Database sample
Arrgghhh! My fault again. I knew Rich had updated the database, but I
obviously forgot to overwrite my existing copy before scripting the stuff
out. Attached are the scripts from the new db.
Dave
"Chris Loris" <cloris@c...> wrote in message news:9828@a...
>
> In the SQL Scripts, it looks like they were produced form an older
> database. There is a discrpenacy with field names in the Accounts Table
> and the case is different for the column names in the orders table. This
> causes a problem in some of the code that is case sensitive to column
> names.
>
> Also, some of the product header graphics are named plurally (ie,
> bootsigif) when they are referred to singularly in the code... boot.gif.
>
> Chris Loris
> http://loris.dyndns.org
>
>
---
Message #2 by Gregory_Griffiths@c... on Fri, 25 Aug 2000 10:52:00 +0100
|
|
when you say dislike what do you mean ? If you mean it doesn't return
anything, try putting the wildcard characters (% or *) either side of
your var, or convert the entire variable and the field into upper or
lower case to ensure no case issues.
> -----Original Message-----
> From: b.duffy@m... [mailto:b.duffy@m...]
> Sent: 25 August 2000 18:34
> To: asp_databases@p...
> Cc: b.duffy@m...
> Subject: FW: [asp_databases] RE: LIKE
>
>
> sqlQuery = "SELECT * FROM bernie"
> sqlQuery = sqlQuery & " WHERE County LIKE '" & scounty & "' "
>
> Can anyone tell me what is wrong with the above statement.
> The fields etc
> are valid names. When I use = everything works fine. I seems
> to dislike this
> LIKE command. Any ideas?
>
Message #3 by Michael Flanagan <Michael.Flanagan@a...> on Fri, 25 Aug 2000 11:02:06 +0100
|
|
MAYBE YOU SHOULD CHANGE IT TO
sqlQuery = "SELECT * FROM bernie"
sqlQuery = sqlQuery & " WHERE County LIKE '" & scounty & "%' "
-----Original Message-----
From: Bernadette Duffy
Sent: 25 August 2000 18:34
To: ASP Databases
Subject: [asp_databases] RE: LIKE
sqlQuery = "SELECT * FROM bernie"
sqlQuery = sqlQuery & " WHERE County LIKE '" & scounty & "' "
Can anyone tell me what is wrong with the above statement. The fields etc
are valid names. When I use = everything works fine. I seems to dislike this
LIKE command. Any ideas?
Message #4 by "Ray Murphy" <raymondmurphy@c...> on Fri, 25 Aug 2000 11:17:5
|
|
Bernadette,
LIKE needs the '%' wildcard character at the end of the string you're
looking for - so change you're code to :
WHERE County LIKE '" & scounty & "%' "
HTH.
Ray
Message #5 by SCOTT.A.STEWART@c... on Fri, 25 Aug 2000 16:41:56 -0400
|
|
Try this
sqlQuery = "SELECT * FROM bernie"
sqlQuery = sqlQuery & " WHERE County LIKE '%" & scounty & "'% "
The percent signs indicate wildcards in the like predicate.
Hope this helps
Scott Stewart
____________________Reply Separator____________________
Subject: [asp_databases] RE: LIKE
Author: "ASP Databases" <asp_databases@p...>
Date: 8/25/00 1:33 PM
sqlQuery = "SELECT * FROM bernie"
sqlQuery = sqlQuery & " WHERE County LIKE '" & scounty & "' "
Can anyone tell me what is wrong with the above statement. The fields etc
are valid names. When I use = everything works fine. I seems to dislike this
LIKE command. Any ideas?
Message #6 by "Ken Schaefer" <ken@a...> on Mon, 28 Aug 2000 11:57:05 +1000
|
|
http://www.adOpenStatic.com/faq/likequeries.htm
Basically LIKE * is JET SQL, not ANSI SQL, and you need to use ANSI SQL with
ADO/OLEDB (see the URL for details).
Cheers
Ken
----- Original Message -----
From: "Bernadette Duffy" <b.duffy@m...>
To: "ASP Databases" <asp_databases@p...>
Sent: Saturday, August 26, 2000 3:33 AM
Subject: [asp_databases] RE: LIKE
> sqlQuery = "SELECT * FROM bernie"
> sqlQuery = sqlQuery & " WHERE County LIKE '" & scounty & "' "
>
> Can anyone tell me what is wrong with the above statement. The fields etc
> are valid names. When I use = everything works fine. I seems to dislike
this
> LIKE command. Any ideas?
|
|
 |