Re: delimiters, sql, joins, AHHH!
From: John (noway_at_amIgivingitouthere.com)
Date: 02/09/05
- Next message: larrybud2002_at_yahoo.com: "Re: delimiters, sql, joins, AHHH!"
- Previous message: Roland Hall: "Re: ASP sessionstate"
- In reply to: Bob Barrows [MVP]: "Re: delimiters, sql, joins, AHHH!"
- Next in thread: Bob Barrows [MVP]: "Re: delimiters, sql, joins, AHHH!"
- Reply: Bob Barrows [MVP]: "Re: delimiters, sql, joins, AHHH!"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 09 Feb 2005 15:34:52 GMT
I'm doing this but I still can't get the recordset to match what is being
edited. I'm just not seeing it??
<%
Set rsGigPlace = Server.CreateObject("ADODB.Recordset")
gigPlaceSQL = "SELECT * FROM places ORDER BY placeName ASC;"
rsGigPlace.CursorType = 3
rsGigPlace.Open gigPlaceSQL, gigsCon
Response.write _
"<select name='location'>"
While Not rsGigPlace.EOF
Response.write _
"<option value='" & rsGigPlace("placeName") & "'"
If Replace(rsGigPlace("placeName"),"'","''") =
Replace(rsGigEdit("gigPlace"),"'","''") Then Response.write "selected" End
If
Response.write _
">" & rsGigPlace("placeName") & "</option>"
rsGigPlace.MoveNext
Wend
rsGigPlace.Close
Set rsGigPlace = nothing
Response.write "</select>"
%>
(rsGigEdit is from another recordset still open)
the html being produced....
<td>
<select name='location'><option value='Benefit Concert'>Benefit
Concert</option><option value='Fat Moe's'>Fat Moe's</option><option
value='Froggy's'>Froggy's</option><option value='George Eastman
House'>George Eastman House</option><option
value='Georgio's'>Georgio's</option><option value='TBA'>TBA</option><option
value='The Panorama'>The Panorama</option></select>
</td>
> 2. If it's a character/text field, then you must supply string data by
> delimiting the data either with single or double quotes. If the data
> contains literal quotes, you must escape them by doubling them. This means
> that if you use single quotes (apostrophes) for your string delimiters,
and
> the data contains an apostrophe, then you must replace the apostrophe with
> two apostrophes, like this:
> Update tbl set textfield = 'O''Malley'
> In Access, you can use double quotes for your delimiters, so this will
work
> as well:
> Update tbl set textfield = "O'Malley"
> Note: you don't have to escape the apostrophe in O'Malley when you use
> double quotes as the delimiter. However, you will need to escape the
double
> quotes when assigning this statement to a variable:
> sSQL = "Update tbl set textfield = ""O'Malley"""
> So most people will use the single quotes and escape the apostrophe:
> sName = "O'Malley"
> sSQL = "Update tbl set textfield = '" & Replace(sName,"'","''") & "'"
> response.write sSQL
- Next message: larrybud2002_at_yahoo.com: "Re: delimiters, sql, joins, AHHH!"
- Previous message: Roland Hall: "Re: ASP sessionstate"
- In reply to: Bob Barrows [MVP]: "Re: delimiters, sql, joins, AHHH!"
- Next in thread: Bob Barrows [MVP]: "Re: delimiters, sql, joins, AHHH!"
- Reply: Bob Barrows [MVP]: "Re: delimiters, sql, joins, AHHH!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|