Ask a Question related to ASP, Design and Development.
-
Robert Mark Bram #1
Too few parameters to RecordSet.Open?
Hi All!
My ASP page below receives the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/polyprint/test.asp, line 31
Line 31 is this line from below:
newsletterText.open (sql);
The sql statement works ok in Access and I have used the ConnectionString on
other pages, so it works too. I have also used Open() in this way on other
pages..
I am a loss to know what other parameters are expected!
Any advice would be welcome!
Rob
:)
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/adojavas.inc"-->
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
/*
This works ok!
SELECT * FROM newsletterText
WHERE pageName="1"
and language="English"
order by paragraph
*/
var sql ="SELECT * FROM newsletterText " +
"WHERE pageName=\"1\"" +
" and language=\"English\" " +
"order by paragraph";
Response.Write( sql + "<br>");
var polyprintConnection = Server.CreateObject ("ADODB.Connection");
polyprintConnection.ConnectionString="DSN=Polyprin tNewsletter";
polyprintConnection.Open();
var newsletterText = Server.CreateObject ("ADODB.Recordset");
newsletterText.ActiveConnection = polyprintConnection;
newsletterText.CursorType = adOpenForwardOnly;
newsletterText.CursorLocation = adUseClient;
newsletterText.LockType = adLockReadOnly;
newsletterText.open (sql);
%>
</body>
</html>
Robert Mark Bram Guest
-
Open parameters do not work
The open parameters specified in URL (e.g. <http://partners.adobe.com/asn/acrobat/sdk/public/docs/PDFOpenParams.pdf#page=6)> do not work (neither in... -
using Command to set Parameters and Recordset to retrive the Query
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under... -
ADO recordset open method - pagecount -1
Hi I have used ADO recordset open method on a ASP page for the sql command string its a name of a Stored Proc as follows Set conn =... -
objRS.Open parameters
Are the values of adOpenForwardOnly and adLockOptimistic assigned automatically on the server or should I be preloading these with their numeric... -
new to asp and ado from dao and vb, can't open mdb/recordset
It's got nothing to do with your connection string. An asp pabe knows nothing about the ADO constants (adOpenDynamic, etc.) unless you tell it... -
Manohar Kamath [MVP] #2
Re: Too few parameters to RecordSet.Open?
Looks like you might have misspelt the field names in your SQL, or they do
not exist. Plus, the delimiter for a string is ' in SQL
var sql ="SELECT * FROM newsletterText " +
"WHERE pageName='1'" +
" and language='English' " +
"order by paragraph";
--
Manohar Kamath
Editor, .netBooks
[url]www.dotnetbooks.com[/url]
--
Manohar Kamath
Editor, .netBooks
[url]www.dotnetbooks.com[/url]
"Robert Mark Bram" <relaxedrob@removethis.optushome.com.au> wrote in message
news:3f908bb3$0$10617$afc38c87@news.optusnet.com.a u...on> Hi All!
>
> My ASP page below receives the following error:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
> /polyprint/test.asp, line 31
>
> Line 31 is this line from below:
> newsletterText.open (sql);
>
> The sql statement works ok in Access and I have used the ConnectionString> other pages, so it works too. I have also used Open() in this way on other
> pages..
>
> I am a loss to know what other parameters are expected!
>
> Any advice would be welcome!
>
> Rob
> :)
>
>
> <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
> <!--#include virtual="/adojavas.inc"-->
> <html><head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> </head>
> <body>
> <%
> /*
> This works ok!
> SELECT * FROM newsletterText
> WHERE pageName="1"
> and language="English"
> order by paragraph
> */
> var sql ="SELECT * FROM newsletterText " +
> "WHERE pageName=\"1\"" +
> " and language=\"English\" " +
> "order by paragraph";
>
> Response.Write( sql + "<br>");
>
> var polyprintConnection = Server.CreateObject ("ADODB.Connection");
> polyprintConnection.ConnectionString="DSN=Polyprin tNewsletter";
> polyprintConnection.Open();
>
> var newsletterText = Server.CreateObject ("ADODB.Recordset");
> newsletterText.ActiveConnection = polyprintConnection;
> newsletterText.CursorType = adOpenForwardOnly;
> newsletterText.CursorLocation = adUseClient;
> newsletterText.LockType = adLockReadOnly;
> newsletterText.open (sql);
> %>
> </body>
> </html>
>
>
Manohar Kamath [MVP] Guest
-
Robert Mark Bram #3
Re: Too few parameters to RecordSet.Open?
Ah ha!
Thank you Manohar, I was using the wrong delimiter!
Rob
:)
Robert Mark Bram Guest



Reply With Quote

