ADODB Command Error

M

Martin Prunty

I have recently added a database query to Frontpage using the Database
Interface Wizard. After publishing and testing, the query returns the
following error message:

ADODB.Command error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name
or ordinal.

It then references the following: _fpclass/fpdbrgn1.inc, line 408

Can anyone give me an idea how to fix this problem?

Thank you.
 
M

MD Websunlimited

The message indicates that the name used for one of the database table columns is not present in the table being referenced. Check
your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
 
M

Martin Prunty

Many thanks.

Could this be a result of using parameters in the query statement? I've
tried to set the query up so the user can enter a date range (Start Date) and
(End Date), which are not actual fields in the table. If this is the cause,
do you have any suggestions on how to set this up so I won't encounter the
original problem?

Thanks again.
 
S

Stefan B Rusynko

Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Many thanks.
|
| Could this be a result of using parameters in the query statement? I've
| tried to set the query up so the user can enter a date range (Start Date) and
| (End Date), which are not actual fields in the table. If this is the cause,
| do you have any suggestions on how to set this up so I won't encounter the
| original problem?
|
| Thanks again.
|
| "MD Websunlimited" wrote:
|
| > The message indicates that the name used for one of the database table columns is not present in the table being referenced.
Check
| > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| >
| > --
| > Mike -- FrontPage MVP '97 - '02
| > http://www.websunlimited.com
| > FrontPage Add-in
| >
| >
| > >I have recently added a database query to Frontpage using the Database
| > > Interface Wizard. After publishing and testing, the query returns the
| > > following error message:
| > >
| > > ADODB.Command error '800a0cc1'
| > > Item cannot be found in the collection corresponding to the requested name
| > > or ordinal.
| > >
| > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > >
| > > Can anyone give me an idea how to fix this problem?
| > >
| > > Thank you.
| >
| >
| >
 
M

Martin Prunty

Here is the code associated with the query. Thanks for your help.


PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
Text ( 255 );
SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email,
DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
FROM Results
GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email
HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
((Results.Timestamp) Between [Start Date] And [End Date]))
ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;


Stefan B Rusynko said:
Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Many thanks.
|
| Could this be a result of using parameters in the query statement? I've
| tried to set the query up so the user can enter a date range (Start Date) and
| (End Date), which are not actual fields in the table. If this is the cause,
| do you have any suggestions on how to set this up so I won't encounter the
| original problem?
|
| Thanks again.
|
| "MD Websunlimited" wrote:
|
| > The message indicates that the name used for one of the database table columns is not present in the table being referenced.
Check
| > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| >
| > --
| > Mike -- FrontPage MVP '97 - '02
| > http://www.websunlimited.com
| > FrontPage Add-in
| >
| >
| > >I have recently added a database query to Frontpage using the Database
| > > Interface Wizard. After publishing and testing, the query returns the
| > > following error message:
| > >
| > > ADODB.Command error '800a0cc1'
| > > Item cannot be found in the collection corresponding to the requested name
| > > or ordinal.
| > >
| > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > >
| > > Can anyone give me an idea how to fix this problem?
| > >
| > > Thank you.
| >
| >
| >
 
S

Stefan B Rusynko

1) bad practice and will cause you problems to use ANY field names or variable names w/ spaces in them
Rename them in your DB or your scripts to:
Start_Date, End_Date, Insurance_Company

- am presuming from your code snippet that Start_Date, End_Date and Insurance_Company are coming from form fields

2) Yes you can not use PARAMETER
- you need to get the form field values from the form using valid ASP code as say
<%
Start_Date = Cdate(Request.Form("Start_Date"))
End_Date = Cdate(Request.Form("End_Date"))
Insurance_Company = Request.Form("Insurance_Company")
%>
Note that the above code will fail if your form passed any values that are not valid dates

3 ) You need to correctly date delimit (#for dates) any date variables, or other parameters (' for text), and separate the string
from the ASP variable (using &) in your ASP code which should look like:

<%
strSQL= "SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email, Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records] FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept, Results.Claim_Number, Results.Requester,
Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" & Insurance_Company & "' AND
((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"

%>

PS
can't guarantee your query will work as you were using Access syntax unsupported by ASP (Dcount change to Count, HAVING chges to
WHERE)

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Here is the code associated with the query. Thanks for your help.
|
|
| PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
| Text ( 255 );
| SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email,
| DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
| FROM Results
| GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email
| HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
| ((Results.Timestamp) Between [Start Date] And [End Date]))
| ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;
|
|
| "Stefan B Rusynko" wrote:
|
| > Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | Many thanks.
| > |
| > | Could this be a result of using parameters in the query statement? I've
| > | tried to set the query up so the user can enter a date range (Start Date) and
| > | (End Date), which are not actual fields in the table. If this is the cause,
| > | do you have any suggestions on how to set this up so I won't encounter the
| > | original problem?
| > |
| > | Thanks again.
| > |
| > | "MD Websunlimited" wrote:
| > |
| > | > The message indicates that the name used for one of the database table columns is not present in the table being referenced.
| > Check
| > | > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| > | >
| > | > --
| > | > Mike -- FrontPage MVP '97 - '02
| > | > http://www.websunlimited.com
| > | > FrontPage Add-in
| > | >
| > | >
| > | > | > >I have recently added a database query to Frontpage using the Database
| > | > > Interface Wizard. After publishing and testing, the query returns the
| > | > > following error message:
| > | > >
| > | > > ADODB.Command error '800a0cc1'
| > | > > Item cannot be found in the collection corresponding to the requested name
| > | > > or ordinal.
| > | > >
| > | > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > | > >
| > | > > Can anyone give me an idea how to fix this problem?
| > | > >
| > | > > Thank you.
| > | >
| > | >
| > | >
| >
| >
| >
 
M

Martin Prunty

First an apology. Somehow, I didn't understand your response below. I've
attempted to make your recommended code work, but have run into a problem
with the query.

When I enter the query you've suggested, Access seems to have a problem that
the SQL code doesn't start with "Select", "Update", "Delete", etc. Here's
the code I used:

<%
strSQL= "SELECT Results.Insurance_Company, Results.Timestamp,
Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email,
Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester,
Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND
((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#))
ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"

%>

I understand that I will also have to enter the other code you suggested
into the Form.

Your help will be appreciated.

Stefan B Rusynko said:
1) bad practice and will cause you problems to use ANY field names or variable names w/ spaces in them
Rename them in your DB or your scripts to:
Start_Date, End_Date, Insurance_Company

- am presuming from your code snippet that Start_Date, End_Date and Insurance_Company are coming from form fields

2) Yes you can not use PARAMETER
- you need to get the form field values from the form using valid ASP code as say
<%
Start_Date = Cdate(Request.Form("Start_Date"))
End_Date = Cdate(Request.Form("End_Date"))
Insurance_Company = Request.Form("Insurance_Company")
%>
Note that the above code will fail if your form passed any values that are not valid dates

3 ) You need to correctly date delimit (#for dates) any date variables, or other parameters (' for text), and separate the string
from the ASP variable (using &) in your ASP code which should look like:

<%
strSQL= "SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email, Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records] FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept, Results.Claim_Number, Results.Requester,
Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" & Insurance_Company & "' AND
((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"

%>

PS
can't guarantee your query will work as you were using Access syntax unsupported by ASP (Dcount change to Count, HAVING chges to
WHERE)

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Here is the code associated with the query. Thanks for your help.
|
|
| PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
| Text ( 255 );
| SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email,
| DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
| FROM Results
| GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email
| HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
| ((Results.Timestamp) Between [Start Date] And [End Date]))
| ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;
|
|
| "Stefan B Rusynko" wrote:
|
| > Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | Many thanks.
| > |
| > | Could this be a result of using parameters in the query statement? I've
| > | tried to set the query up so the user can enter a date range (Start Date) and
| > | (End Date), which are not actual fields in the table. If this is the cause,
| > | do you have any suggestions on how to set this up so I won't encounter the
| > | original problem?
| > |
| > | Thanks again.
| > |
| > | "MD Websunlimited" wrote:
| > |
| > | > The message indicates that the name used for one of the database table columns is not present in the table being referenced.
| > Check
| > | > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| > | >
| > | > --
| > | > Mike -- FrontPage MVP '97 - '02
| > | > http://www.websunlimited.com
| > | > FrontPage Add-in
| > | >
| > | >
| > | > | > >I have recently added a database query to Frontpage using the Database
| > | > > Interface Wizard. After publishing and testing, the query returns the
| > | > > following error message:
| > | > >
| > | > > ADODB.Command error '800a0cc1'
| > | > > Item cannot be found in the collection corresponding to the requested name
| > | > > or ordinal.
| > | > >
| > | > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > | > >
| > | > > Can anyone give me an idea how to fix this problem?
| > | > >
| > | > > Thank you.
| > | >
| > | >
| > | >
| >
| >
| >
 
S

Stefan B Rusynko

My post was using a string variable () to built a select (to be used in hand coded ASP)

If you are using wizards don't wrap the whole thing in the string variable
strSQL = " ..... "
It is just

SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone, Results.Requester_Email,
Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| First an apology. Somehow, I didn't understand your response below. I've
| attempted to make your recommended code work, but have run into a problem
| with the query.
|
| When I enter the query you've suggested, Access seems to have a problem that
| the SQL code doesn't start with "Select", "Update", "Delete", etc. Here's
| the code I used:
|
| <%
| strSQL= "SELECT Results.Insurance_Company, Results.Timestamp,
| Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email,
| Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
| FROM Results GROUP BY
| Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester,
| Results.Requester_Telephone,
| Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
| Insurance_Company & "' AND
| ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#))
| ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"
|
| %>
|
| I understand that I will also have to enter the other code you suggested
| into the Form.
|
| Your help will be appreciated.
|
| "Stefan B Rusynko" wrote:
|
| > 1) bad practice and will cause you problems to use ANY field names or variable names w/ spaces in them
| > Rename them in your DB or your scripts to:
| > Start_Date, End_Date, Insurance_Company
| >
| > - am presuming from your code snippet that Start_Date, End_Date and Insurance_Company are coming from form fields
| >
| > 2) Yes you can not use PARAMETER
| > - you need to get the form field values from the form using valid ASP code as say
| > <%
| > Start_Date = Cdate(Request.Form("Start_Date"))
| > End_Date = Cdate(Request.Form("End_Date"))
| > Insurance_Company = Request.Form("Insurance_Company")
| > %>
| > Note that the above code will fail if your form passed any values that are not valid dates
| >
| > 3 ) You need to correctly date delimit (#for dates) any date variables, or other parameters (' for text), and separate the
string
| > from the ASP variable (using &) in your ASP code which should look like:
| >
| > <%
| > strSQL= "SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > Results.Requester_Email, Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records] FROM Results GROUP BY
| > Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept, Results.Claim_Number, Results.Requester,
| > Results.Requester_Telephone,
| > Results.Requester_Email WHERE (((Results.Insurance_Company)='" & Insurance_Company & "' AND
| > ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC, Results.Branch_Dept
DESC"
| >
| > %>
| >
| > PS
| > can't guarantee your query will work as you were using Access syntax unsupported by ASP (Dcount change to Count, HAVING chges to
| > WHERE)
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | Here is the code associated with the query. Thanks for your help.
| > |
| > |
| > | PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
| > | Text ( 255 );
| > | SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email,
| > | DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
| > | FROM Results
| > | GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email
| > | HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
| > | ((Results.Timestamp) Between [Start Date] And [End Date]))
| > | ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;
| > |
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > | > _____________________________________________
| > | >
| > | >
| > | > | > | Many thanks.
| > | > |
| > | > | Could this be a result of using parameters in the query statement? I've
| > | > | tried to set the query up so the user can enter a date range (Start Date) and
| > | > | (End Date), which are not actual fields in the table. If this is the cause,
| > | > | do you have any suggestions on how to set this up so I won't encounter the
| > | > | original problem?
| > | > |
| > | > | Thanks again.
| > | > |
| > | > | "MD Websunlimited" wrote:
| > | > |
| > | > | > The message indicates that the name used for one of the database table columns is not present in the table being
referenced.
| > | > Check
| > | > | > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| > | > | >
| > | > | > --
| > | > | > Mike -- FrontPage MVP '97 - '02
| > | > | > http://www.websunlimited.com
| > | > | > FrontPage Add-in
| > | > | >
| > | > | >
| > | > | > | > | > >I have recently added a database query to Frontpage using the Database
| > | > | > > Interface Wizard. After publishing and testing, the query returns the
| > | > | > > following error message:
| > | > | > >
| > | > | > > ADODB.Command error '800a0cc1'
| > | > | > > Item cannot be found in the collection corresponding to the requested name
| > | > | > > or ordinal.
| > | > | > >
| > | > | > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > | > | > >
| > | > | > > Can anyone give me an idea how to fix this problem?
| > | > | > >
| > | > | > > Thank you.
| > | > | >
| > | > | >
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >
 
M

Martin Prunty

Thanks for your response. I've tried the new query, but I am still getting
an error message, which is:

Syntax error, (missing operator) in query expression
'Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC'

I entered the code you recommended directly into the SQL view of the query
exactly as you had suggested. Any thoughts?

Thanks for your assistance.

Stefan B Rusynko said:
My post was using a string variable () to built a select (to be used in hand coded ASP)

If you are using wizards don't wrap the whole thing in the string variable
strSQL = " ..... "
It is just

SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone, Results.Requester_Email,
Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| First an apology. Somehow, I didn't understand your response below. I've
| attempted to make your recommended code work, but have run into a problem
| with the query.
|
| When I enter the query you've suggested, Access seems to have a problem that
| the SQL code doesn't start with "Select", "Update", "Delete", etc. Here's
| the code I used:
|
| <%
| strSQL= "SELECT Results.Insurance_Company, Results.Timestamp,
| Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email,
| Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
| FROM Results GROUP BY
| Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester,
| Results.Requester_Telephone,
| Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
| Insurance_Company & "' AND
| ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#))
| ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"
|
| %>
|
| I understand that I will also have to enter the other code you suggested
| into the Form.
|
| Your help will be appreciated.
|
| "Stefan B Rusynko" wrote:
|
| > 1) bad practice and will cause you problems to use ANY field names or variable names w/ spaces in them
| > Rename them in your DB or your scripts to:
| > Start_Date, End_Date, Insurance_Company
| >
| > - am presuming from your code snippet that Start_Date, End_Date and Insurance_Company are coming from form fields
| >
| > 2) Yes you can not use PARAMETER
| > - you need to get the form field values from the form using valid ASP code as say
| > <%
| > Start_Date = Cdate(Request.Form("Start_Date"))
| > End_Date = Cdate(Request.Form("End_Date"))
| > Insurance_Company = Request.Form("Insurance_Company")
| > %>
| > Note that the above code will fail if your form passed any values that are not valid dates
| >
| > 3 ) You need to correctly date delimit (#for dates) any date variables, or other parameters (' for text), and separate the
string
| > from the ASP variable (using &) in your ASP code which should look like:
| >
| > <%
| > strSQL= "SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > Results.Requester_Email, Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records] FROM Results GROUP BY
| > Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept, Results.Claim_Number, Results.Requester,
| > Results.Requester_Telephone,
| > Results.Requester_Email WHERE (((Results.Insurance_Company)='" & Insurance_Company & "' AND
| > ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC, Results.Branch_Dept
DESC"
| >
| > %>
| >
| > PS
| > can't guarantee your query will work as you were using Access syntax unsupported by ASP (Dcount change to Count, HAVING chges to
| > WHERE)
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | Here is the code associated with the query. Thanks for your help.
| > |
| > |
| > | PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
| > | Text ( 255 );
| > | SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email,
| > | DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
| > | FROM Results
| > | GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email
| > | HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
| > | ((Results.Timestamp) Between [Start Date] And [End Date]))
| > | ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;
| > |
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > | > _____________________________________________
| > | >
| > | >
| > | > | > | Many thanks.
| > | > |
| > | > | Could this be a result of using parameters in the query statement? I've
| > | > | tried to set the query up so the user can enter a date range (Start Date) and
| > | > | (End Date), which are not actual fields in the table. If this is the cause,
| > | > | do you have any suggestions on how to set this up so I won't encounter the
| > | > | original problem?
| > | > |
| > | > | Thanks again.
| > | > |
| > | > | "MD Websunlimited" wrote:
| > | > |
| > | > | > The message indicates that the name used for one of the database table columns is not present in the table being
referenced.
| > | > Check
| > | > | > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| > | > | >
| > | > | > --
| > | > | > Mike -- FrontPage MVP '97 - '02
| > | > | > http://www.websunlimited.com
| > | > | > FrontPage Add-in
| > | > | >
| > | > | >
| > | > | > | > | > >I have recently added a database query to Frontpage using the Database
| > | > | > > Interface Wizard. After publishing and testing, the query returns the
| > | > | > > following error message:
| > | > | > >
| > | > | > > ADODB.Command error '800a0cc1'
| > | > | > > Item cannot be found in the collection corresponding to the requested name
| > | > | > > or ordinal.
| > | > | > >
| > | > | > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > | > | > >
| > | > | > > Can anyone give me an idea how to fix this problem?
| > | > | > >
| > | > | > > Thank you.
| > | > | >
| > | > | >
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >
 
M

Martin Prunty

Thanks for your response. I've tried the new query, but I am still getting
an error message, which is:

Syntax error, (missing operator) in query expression
'Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC'

I entered the code you recommended directly into the SQL view of the query
exactly as you had suggested. Any thoughts?

Thanks for your assistance.



Martin Prunty said:
Thanks for your response. I've tried the new query, but I am still getting
an error message, which is:

Syntax error, (missing operator) in query expression
'Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC'

I entered the code you recommended directly into the SQL view of the query
exactly as you had suggested. Any thoughts?

Thanks for your assistance.

Stefan B Rusynko said:
My post was using a string variable () to built a select (to be used in hand coded ASP)

If you are using wizards don't wrap the whole thing in the string variable
strSQL = " ..... "
It is just

SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone, Results.Requester_Email,
Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| First an apology. Somehow, I didn't understand your response below. I've
| attempted to make your recommended code work, but have run into a problem
| with the query.
|
| When I enter the query you've suggested, Access seems to have a problem that
| the SQL code doesn't start with "Select", "Update", "Delete", etc. Here's
| the code I used:
|
| <%
| strSQL= "SELECT Results.Insurance_Company, Results.Timestamp,
| Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email,
| Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
| FROM Results GROUP BY
| Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester,
| Results.Requester_Telephone,
| Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
| Insurance_Company & "' AND
| ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#))
| ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"
|
| %>
|
| I understand that I will also have to enter the other code you suggested
| into the Form.
|
| Your help will be appreciated.
|
| "Stefan B Rusynko" wrote:
|
| > 1) bad practice and will cause you problems to use ANY field names or variable names w/ spaces in them
| > Rename them in your DB or your scripts to:
| > Start_Date, End_Date, Insurance_Company
| >
| > - am presuming from your code snippet that Start_Date, End_Date and Insurance_Company are coming from form fields
| >
| > 2) Yes you can not use PARAMETER
| > - you need to get the form field values from the form using valid ASP code as say
| > <%
| > Start_Date = Cdate(Request.Form("Start_Date"))
| > End_Date = Cdate(Request.Form("End_Date"))
| > Insurance_Company = Request.Form("Insurance_Company")
| > %>
| > Note that the above code will fail if your form passed any values that are not valid dates
| >
| > 3 ) You need to correctly date delimit (#for dates) any date variables, or other parameters (' for text), and separate the
string
| > from the ASP variable (using &) in your ASP code which should look like:
| >
| > <%
| > strSQL= "SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > Results.Requester_Email, Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records] FROM Results GROUP BY
| > Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept, Results.Claim_Number, Results.Requester,
| > Results.Requester_Telephone,
| > Results.Requester_Email WHERE (((Results.Insurance_Company)='" & Insurance_Company & "' AND
| > ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC, Results.Branch_Dept
DESC"
| >
| > %>
| >
| > PS
| > can't guarantee your query will work as you were using Access syntax unsupported by ASP (Dcount change to Count, HAVING chges to
| > WHERE)
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | Here is the code associated with the query. Thanks for your help.
| > |
| > |
| > | PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
| > | Text ( 255 );
| > | SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email,
| > | DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
| > | FROM Results
| > | GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email
| > | HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
| > | ((Results.Timestamp) Between [Start Date] And [End Date]))
| > | ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;
| > |
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > | > _____________________________________________
| > | >
| > | >
| > | > | > | Many thanks.
| > | > |
| > | > | Could this be a result of using parameters in the query statement? I've
| > | > | tried to set the query up so the user can enter a date range (Start Date) and
| > | > | (End Date), which are not actual fields in the table. If this is the cause,
| > | > | do you have any suggestions on how to set this up so I won't encounter the
| > | > | original problem?
| > | > |
| > | > | Thanks again.
| > | > |
| > | > | "MD Websunlimited" wrote:
| > | > |
| > | > | > The message indicates that the name used for one of the database table columns is not present in the table being
referenced.
| > | > Check
| > | > | > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| > | > | >
| > | > | > --
| > | > | > Mike -- FrontPage MVP '97 - '02
| > | > | > http://www.websunlimited.com
| > | > | > FrontPage Add-in
| > | > | >
| > | > | >
| > | > | > | > | > >I have recently added a database query to Frontpage using the Database
| > | > | > > Interface Wizard. After publishing and testing, the query returns the
| > | > | > > following error message:
| > | > | > >
| > | > | > > ADODB.Command error '800a0cc1'
| > | > | > > Item cannot be found in the collection corresponding to the requested name
| > | > | > > or ordinal.
| > | > | > >
| > | > | > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > | > | > >
| > | > | > > Can anyone give me an idea how to fix this problem?
| > | > | > >
| > | > | > > Thank you.
| > | > | >
| > | > | >
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >
 
M

Martin Prunty

Hello,

I would really appreciate your help. This one's getting old, but I never
have been able to figure out what is wrong with the query you've described
below. When I attempt to use this, I get an error message that there is a
syntax error. Can you take a look and advise me on how to fix this? Thank
you.

Stefan B Rusynko said:
My post was using a string variable () to built a select (to be used in hand coded ASP)

If you are using wizards don't wrap the whole thing in the string variable
strSQL = " ..... "
It is just

SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone, Results.Requester_Email,
Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
FROM Results GROUP BY
Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
Insurance_Company & "' AND ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC,
Results.Branch_Dept DESC

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| First an apology. Somehow, I didn't understand your response below. I've
| attempted to make your recommended code work, but have run into a problem
| with the query.
|
| When I enter the query you've suggested, Access seems to have a problem that
| the SQL code doesn't start with "Select", "Update", "Delete", etc. Here's
| the code I used:
|
| <%
| strSQL= "SELECT Results.Insurance_Company, Results.Timestamp,
| Results.Branch_Dept,
| Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| Results.Requester_Email,
| Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records]
| FROM Results GROUP BY
| Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| Results.Claim_Number, Results.Requester,
| Results.Requester_Telephone,
| Results.Requester_Email WHERE (((Results.Insurance_Company)='" &
| Insurance_Company & "' AND
| ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#))
| ORDER BY Results.Timestamp DESC, Results.Branch_Dept DESC"
|
| %>
|
| I understand that I will also have to enter the other code you suggested
| into the Form.
|
| Your help will be appreciated.
|
| "Stefan B Rusynko" wrote:
|
| > 1) bad practice and will cause you problems to use ANY field names or variable names w/ spaces in them
| > Rename them in your DB or your scripts to:
| > Start_Date, End_Date, Insurance_Company
| >
| > - am presuming from your code snippet that Start_Date, End_Date and Insurance_Company are coming from form fields
| >
| > 2) Yes you can not use PARAMETER
| > - you need to get the form field values from the form using valid ASP code as say
| > <%
| > Start_Date = Cdate(Request.Form("Start_Date"))
| > End_Date = Cdate(Request.Form("End_Date"))
| > Insurance_Company = Request.Form("Insurance_Company")
| > %>
| > Note that the above code will fail if your form passed any values that are not valid dates
| >
| > 3 ) You need to correctly date delimit (#for dates) any date variables, or other parameters (' for text), and separate the
string
| > from the ASP variable (using &) in your ASP code which should look like:
| >
| > <%
| > strSQL= "SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > Results.Requester_Email, Count("Insurance_Company","Insurance_Company_By_Date") AS [Total_Records] FROM Results GROUP BY
| > Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept, Results.Claim_Number, Results.Requester,
| > Results.Requester_Telephone,
| > Results.Requester_Email WHERE (((Results.Insurance_Company)='" & Insurance_Company & "' AND
| > ((Results.Timestamp) => #" & Start_Date & "# And <=#" & End_Date & "#)) ORDER BY Results.Timestamp DESC, Results.Branch_Dept
DESC"
| >
| > %>
| >
| > PS
| > can't guarantee your query will work as you were using Access syntax unsupported by ASP (Dcount change to Count, HAVING chges to
| > WHERE)
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | Here is the code associated with the query. Thanks for your help.
| > |
| > |
| > | PARAMETERS [Start Date] DateTime, [End Date] DateTime, [Insurance Company]
| > | Text ( 255 );
| > | SELECT Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email,
| > | DCount("Insurance_Company","Insurance_Company_By_Date") AS [Total Records]
| > | FROM Results
| > | GROUP BY Results.Insurance_Company, Results.Timestamp, Results.Branch_Dept,
| > | Results.Claim_Number, Results.Requester, Results.Requester_Telephone,
| > | Results.Requester_Email
| > | HAVING (((Results.Insurance_Company)=[Insurance Company]) AND
| > | ((Results.Timestamp) Between [Start Date] And [End Date]))
| > | ORDER BY Results.Timestamp DESC , Results.Branch_Dept DESC;
| > |
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > Post a snippet of your code (the sql string or your query) and the table field name you are comparing the 2 dates against
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > | > _____________________________________________
| > | >
| > | >
| > | > | > | Many thanks.
| > | > |
| > | > | Could this be a result of using parameters in the query statement? I've
| > | > | tried to set the query up so the user can enter a date range (Start Date) and
| > | > | (End Date), which are not actual fields in the table. If this is the cause,
| > | > | do you have any suggestions on how to set this up so I won't encounter the
| > | > | original problem?
| > | > |
| > | > | Thanks again.
| > | > |
| > | > | "MD Websunlimited" wrote:
| > | > |
| > | > | > The message indicates that the name used for one of the database table columns is not present in the table being
referenced.
| > | > Check
| > | > | > your SQL statement and if it is correct; check the table to make sure it has the columns you believe it should.
| > | > | >
| > | > | > --
| > | > | > Mike -- FrontPage MVP '97 - '02
| > | > | > http://www.websunlimited.com
| > | > | > FrontPage Add-in
| > | > | >
| > | > | >
| > | > | > | > | > >I have recently added a database query to Frontpage using the Database
| > | > | > > Interface Wizard. After publishing and testing, the query returns the
| > | > | > > following error message:
| > | > | > >
| > | > | > > ADODB.Command error '800a0cc1'
| > | > | > > Item cannot be found in the collection corresponding to the requested name
| > | > | > > or ordinal.
| > | > | > >
| > | > | > > It then references the following: _fpclass/fpdbrgn1.inc, line 408
| > | > | > >
| > | > | > > Can anyone give me an idea how to fix this problem?
| > | > | > >
| > | > | > > Thank you.
| > | > | >
| > | > | >
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top