Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

OBDC Error

I've got an error message that says the following:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The associated lines of code are as follows:

Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
dbGlobalWeb.Open("depth")

SqlJunk = "SELECT * FROM depth"

If Request.Form("TypeSearch") = "PFL" Then
SqlJunk = SqlJunk & " WHERE PFL LIKE '%" & strTotalString & "%'"
End If

Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
rsGlobalWeb.Open SqlJunk, dbGlobalWeb, 3

Dim rc
rc = rsGlobalWeb.RecordCount

If rc = 0 Then
strURL = "template.asp"
ElseIf rc = 1 Then
Dim intfeet
intfeet = rsGlobalWeb("feet")

ANY SUGGESTIONS AS TO WHAT I AM DOING WRONG??
[873 byte] By [Wex] at [2007-11-9 17:48:09]
# 1 Re: OBDC Error
You've got something misspelled (most likely), consider putting a
response.write before the recordset.open, take the SQL string and paste it
into Access to see what parameter it thinks is missing & you'll see what's
misspelled...

"Wex" <cmccarthyireland@yahoo.com> wrote in message
news:3e245f7a$1@tnews.web.dev-archive.com...
>
> I've got an error message that says the following:
>
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Larry Triezenberg at 2007-11-11 23:17:32 >
# 2 Re: OBDC Error
Nope...still get the same error...

"Larry Triezenberg" <ltriezenberg@pathsys.com> wrote:
>You've got something misspelled (most likely), consider putting a
>response.write before the recordset.open, take the SQL string and paste
it
>into Access to see what parameter it thinks is missing & you'll see what's
>misspelled...
>
>"Wex" <cmccarthyireland@yahoo.com> wrote in message
>news:3e245f7a$1@tnews.web.dev-archive.com...
>>
>> I've got an error message that says the following:
>>
>> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
>> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.
>
>
Wex at 2007-11-11 23:18:38 >
# 3 Re: OBDC Error
verify your system dsn driver.

if u r still getting the error, try to re-install the driver

"Wex" <cmccarthyireland@yahoo.com> wrote:
>
>Nope...still get the same error...
>
>
>
>"Larry Triezenberg" <ltriezenberg@pathsys.com> wrote:
>>You've got something misspelled (most likely), consider putting a
>>response.write before the recordset.open, take the SQL string and paste
>it
>>into Access to see what parameter it thinks is missing & you'll see what's
>>misspelled...
>>
>>"Wex" <cmccarthyireland@yahoo.com> wrote in message
>>news:3e245f7a$1@tnews.web.dev-archive.com...
>>>
>>> I've got an error message that says the following:
>>>
>>> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
>>> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
>1.
>>
>>
>
kk at 2007-11-11 23:19:37 >
# 4 Re: OBDC Error
What's in strTotalString? Maybe a single quote, or a percent sign, or
something else that might be misinterpreted?

"Wex" <cmccarthyireland@yahoo.com> wrote in message
news:3e245f7a$1@tnews.web.dev-archive.com...
>
> I've got an error message that says the following:
>
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.
>
>
> The associated lines of code are as follows:
>
> Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
> dbGlobalWeb.Open("depth")
>
> SqlJunk = "SELECT * FROM depth"
>
> If Request.Form("TypeSearch") = "PFL" Then
> SqlJunk = SqlJunk & " WHERE PFL LIKE '%" & strTotalString & "%'"
> End If
>
> Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
> rsGlobalWeb.Open SqlJunk, dbGlobalWeb, 3
>
> Dim rc
> rc = rsGlobalWeb.RecordCount
>
> If rc = 0 Then
> strURL = "template.asp"
> ElseIf rc = 1 Then
> Dim intfeet
> intfeet = rsGlobalWeb("feet")
Kris Eiben at 2007-11-11 23:20:37 >
# 5 Re: OBDC Error
I had that error when my sql string had something wrong (for example a wrong
field name, a wrong 'WHERE', searching for a string in an integer field,
or similar)

You'd better check your SqlJunk variable before passing it to odbc (look
for "strange" values in strTotalString: it might contain your problem)

"Wex" <cmccarthyireland@yahoo.com> wrote:
>
>I've got an error message that says the following:
>
>Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
>
>
>The associated lines of code are as follows:
>
>Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
> dbGlobalWeb.Open("depth")
>
> SqlJunk = "SELECT * FROM depth"
>
> If Request.Form("TypeSearch") = "PFL" Then
> SqlJunk = SqlJunk & " WHERE PFL LIKE '%" & strTotalString & "%'"
> End If
>
> Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
> rsGlobalWeb.Open SqlJunk, dbGlobalWeb, 3
>
> Dim rc
> rc = rsGlobalWeb.RecordCount
>
> If rc = 0 Then
> strURL = "template.asp"
> ElseIf rc = 1 Then
> Dim intfeet
> intfeet = rsGlobalWeb("feet")
>
>
>
>ANY SUGGESTIONS AS TO WHAT I AM DOING WRONG??
Enrico at 2007-11-11 23:21:42 >