Well, at least I got a different error message! Your version of the query
(cut and pasted for accuracy) returns the following:
Database Results Error
Description: No value given for one or more required parameters.
Number: -2147217904 (0x80040E10)
Source: Microsoft JET Database Engine
I was surprised at your assertion that "ItemCount" can't have spaces, as I
have successfully put spaces in the alias part of the AS clause without
problems for years. Did something change in the Jet engine? BTW, the query
fails with the same error message if I take the quotes away from ItemCount
as well.
For the record, here's the code generated by the DRW; it looks good to me:
<table border="1">
<thead>
<tr>
<td><b>Type</b></td>
<td><b>ItemCount</b></td>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="Type,ItemCount" s-columntypes="202,3"
s-dataconnection="LibraryData" b-tableformat="TRUE" b-menuformat="FALSE"
s-menuchoice="Type" s-menuvalue="Type" b-tableborder="TRUE"
b-tableexpand="FALSE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource
s-displaycolumns="Type,ItemCount" s-criteria s-order s-sql="SELECT DISTINCT
Type, COUNT (Type) AS &quot;ItemCount&quot; FROM LibraryContents
WHERE (Type &lt;&gt; 'Supply') AND <br>(Type &lt;&gt;
'Periodical') GROUP BY Type, ItemCount<br>" b-procedure="FALSE"
clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records
returned." i-maxrecords="256" i-groupsize="0" botid="0"
u-dblib="../_fpclass/fpdblib.inc" u-dbrgn1="../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td
colspan=64 bgcolor="#FFFF00" align="left"
width="100%"><font color="#000000">This is the
start of a Database Results region. The page must be fetched from a web
server with a web browser to display correctly; the current web is stored on
your local disk or network.</font></td></tr>"
b-WasTableFormat="TRUE" startspan --><!--#include
file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT DISTINCT Type, COUNT (Type) AS ""ItemCount"" FROM
LibraryContents WHERE (Type <> 'Supply') AND (Type <> 'Periodical') GROUP
BY Type, ItemCount "
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=2 align=left width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="LibraryData"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Type"
fp_sMenuValue="Type"
fp_iDisplayCols=2
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="35626" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Type,ItemCount" s-column="Type" b-tableformat="TRUE"
b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat
preview="<font
size="-1">&lt;&lt;</font>Type<font
size="-1">&gt;&gt;</font>"
startspan --><%=FP_FieldVal(fp_rs,"Type")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="7359" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Type,ItemCount" s-column="ItemCount" b-tableformat="TRUE"
b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat
preview="<font
size="-1">&lt;&lt;</font>ItemCount<font
size="-1">&gt;&gt;</font>"
startspan --><%=FP_FieldVal(fp_rs,"ItemCount")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="21667" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="TBODY" preview="<tr><td colspan=64
bgcolor="#FFFF00" align="left"
width="100%"><font color="#000000">This is the
end of a Database Results region.</font></td></tr>"
startspan --><!--#include file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>