Skip to main content
April 25, 2006
Question

MM:DataSet and quotes

  • April 25, 2006
  • 2 replies
  • 379 views
I'm trying make a dataset using a select query like:

SELECT MAX(Categories.CategoryID) AS "ID" FROM Categories

When I test the query in the advanced Recordset dialog box it works great, but of course when I put it on my page the command string becomes:

CommandText='<%# "SELECT MAX(Categories.CategoryID) AS "ID" FROM Categories" %>'

Now there's nested quotes, it doesn't work, and I'm too thick to figure out how to nest them...

Help?

Thanks

DOug



This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
April 26, 2006
Try using [] rather than ""

SELECT MAX(Categories.CategoryID) AS [ID] FROM.....

or change the alias to somthing other that ID

SELECT MAX(Categories.CategoryID) AS MaxID FROM....

--
Kevin Marshall
WebXeL.com Ltd
http://www.webxel.com

ASP.NET Dreamweaver Extensions
http://www.webxel-dw.co.uk

"JDM" <webforumsuser@macromedia.com> wrote in message
news:e2lrrj$ns2$1@forums.macromedia.com...
> I'm trying make a dataset using a select query like:
>
> SELECT MAX(Categories.CategoryID) AS "ID" FROM Categories
>
> When I test the query in the advanced Recordset dialog box it works great,
> but
> of course when I put it on my page the command string becomes:
>
> CommandText='<%# "SELECT MAX(Categories.CategoryID) AS "ID" FROM
> Categories"
> %>'
>
> Now there's nested quotes, it doesn't work, and I'm too thick to figure
> out
> how to nest them...
>
> Help?
>
> Thanks
>
> DOug
>
>
>
>
>


Inspiring
April 26, 2006
Try doubling the quotes:

CommandText='<%# "SELECT MAX(Categories.CategoryID) AS ""ID"" FROM
Categories" %>'

HTH,
Randy


> I'm trying make a dataset using a select query like:
>
> SELECT MAX(Categories.CategoryID) AS "ID" FROM Categories
>
> When I test the query in the advanced Recordset dialog box it works great, but
> of course when I put it on my page the command string becomes:
>
> CommandText='<%# "SELECT MAX(Categories.CategoryID) AS "ID" FROM Categories"
> %>'
>
> Now there's nested quotes, it doesn't work