barrykellett
Programmer
I am trying to use the following SQL code:
In my ASP.net page but when i code it as a string:
I get the error:
Conversion from 'Boolean' to 'String' cannot occur in a constant expression.
Code:
SELECT t.Title, DCount('[username]','[guestbook]','[threadid] = ' & gb.threadid) AS CountAllReplies, gb.username
FROM guestbook AS gb INNER JOIN thread AS t ON gb.threadid=t.threadid
WHERE (((gb.Original)=False))
ORDER BY gb.thedate DESC , t.Title, DCount("[username]","[guestbook]","[threadid] = " & gb.threadid), gb.username;
In my ASP.net page but when i code it as a string:
Code:
Const strOleDb as String = "SELECT t.Title, DCount(""[username]"",""[guestbook]"",""[threadid] = "" & gb.threadid) AS CountAllReplies, gb.username" & _
"FROM guestbook AS gb INNER JOIN thread AS t ON gb.threadid=t.threadid" & _
"WHERE (((gb.Original)=False))" & _
"ORDER BY gb.thedate DESC , t.Title, DCount(""[username]"",""[guestbook]"",""[threadid]" = " & gb.threadid), gb.username;"
I get the error:
Conversion from 'Boolean' to 'String' cannot occur in a constant expression.