Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MM:DataSet and quotes

Guest
Apr 25, 2006 Apr 25, 2006
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



TOPICS
Server side applications
378
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 26, 2006 Apr 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 26, 2006 Apr 26, 2006
LATEST
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
>
>
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines