View Full Version : error????HELP!!!!
derick_loo
06-09-2003, 09:41 PM
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
what above error means... Urgent.
Frank
06-09-2003, 10:06 PM
THis is a quote from Microsoft's "Knowledge base"
"SYMPTOMS
If you use ActiveX Data Objects (ADO) to manipulate data in an Access database from within an Active Server Pages (ASP), and you refer to a column in a table that does not exist, you may see the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access 97 Driver] Too few parameters. Expected 1.
CAUSE
This error occurs only with Microsoft Access when one of the column names specified in a select statement does not exist in the table being queried.
RESOLUTION
Remove any invalid column names from the select statement"
This can be found here:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q216/4/25.asp&NoWebContent=1
derick_loo
06-09-2003, 10:17 PM
But i don have any invalid column in database. I select all from datatabase. also got this problem. expected 2 is means wat??
soli cos i'm new in ASP
Frank
06-09-2003, 10:24 PM
Somewhere it is looking for perameters that aren't there. This ofthen happens in SELECT statements. Perhaps if you post the code in question someone may be able to help.
derick_loo
06-09-2003, 10:27 PM
i post it to you, u check it for me can or not? or u have any yahoo id, we chat and told u my problem
my database all field is in text type, not in number, char or other. but still come out this problem
skriptkiddie
06-09-2003, 11:21 PM
If you post the code perhaps someone will help. Only the relevant code - no need to post a complete web page.
derick_loo
06-09-2003, 11:25 PM
below is my dynamic drop down code. when i choose from first drop down, it will show too few parameter. expected 2 error. pls told me wat the problem. All the field in my table is text. not int or other.
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer=true
Response.AddHeader "cache-control", "private"
Response.AddHeader "pragma", "no-cache"
Response.ExpiresAbsolute = #January 1, 1990 00:00:01#
Response.Expires=Now()-1
Response.AddHeader "Cache-Control", "must-revalidate"
Response.AddHeader "Cache-Control", "no-cache"
strScriptName = Request.ServerVariables("SCRIPT_NAME")
If request("Reset")="" then
Category=Request("CategorySelect")
subCategory=Request("subCategorySelect")
sub2Category=Request("sub2CategorySelect")
else
Category=""
subCategory=""
sub2Category=""
end if
dim ARR
If Category <> "" and Category <> "NONE" then
Arr = split(Category,"|")
CatChosen = Arr(0)
MyRegion = Arr(1)
end if
If subCategory <> "" and subCategory <> "NONE" then
Arr = split(subCategory,"|")
sub2CatChosen = Arr(0)
MyCountry = Arr(1)
End if
If sub2Category <> "" and sub2Category <> "NONE"then
Arr = split(sub2Category,"|")
sub3catChosen = Arr(0)
MyCity = Arr(1)
End if
'To show display - check if Category is not blank or unchanged
'----------------------------------------------------
If MyRegion <> "" and (Request("CategorySelect") = Request("CategorySelectOld")) Then
'To show display - check if subCategory is unchanged
'--------------------------------------------
If Request("subCategorySelect") = Request("subCategorySelectOld") then
'To show display - check if sub2Category is selected
'--------------------------------------------
If Request("sub2CategorySelect") <> "" AND Request("sub2CategorySelect") <> "NONE" then
showDisplay = true
End if
End if
else
showDisplay = false
End if
Set catConn = Server.CreateObject("ADODB.Connection")
catConn.Open "DRIVER=Microsoft Access Driver (*.mdb); " & _
"DBQ=" & Server.MapPath("TrainingDatabase_Backup.mdb")
Set catRS = catConn.Execute("SELECT RegionCode, RegionDesc " & _
"FROM Region ORDER BY RegionDesc")
catRows = catRS.getRows
catRS.Close
Set catRS = nothing
'Process input if found
'-------------------------------
showSubcat = False
If (CatChosen <> "" and catChosen <> "NONE") Then
CatChosen = CStr(CatChosen)
showSubcat = True
'get the list of subcategories for given category
'-----------------------------------------------------
Set subRS = catConn.Execute("SELECT * " & _
" FROM Area " & _
" WHERE AreaDescription.RegionCode = " & CatChosen & _
" ORDER BY AreaDescription")
'convert the record set to an array
'-----------------------------------------------
subRows = subRS.getRows
subRS.Close
Set subRS = nothing
End If
showSub2cat = False
If (sub2catChosen <> "" and sub2catChosen <> "NONE") and _
(Request("CategorySelect") = Request("CategorySelectOld")) Then
sub2catChosen = Chr(sub2catChosen)
showSub2cat = True
'get the list of sub2categories for given category
'-----------------------------------------------
Set sub2RS = catConn.Execute("SELECT * " & _
" FROM Corporate " & _
" WHERE ProfileID.AreaCode = " & Sub2CatChosen & _
" ORDER BY ProfileID")
'convert the record set to an array
'-----------------------------------------------
sub2Rows = sub2RS.getRows
sub2RS.Close
Set sub2RS = nothing
End If
' clean up
'------------------------
catConn.Close
Set catConn = nothing
%>
<HTML>
<HEAD>
<TITLE>Multiple Dependent Lists</TITLE>
</HEAD>
<H2>Multiple Dependent Lists</H2>
<HR color="red">
<FONT color='blue' ><I>What destination are you interested in?</I></FONT><br>
First select a Region and then, <br>
select a Country, and then <br>
select a City:
<P>
<FORM Name="DemoForm" Action="<%=StrScriptName%>" Method=Post>
<SELECT Name="CategorySelect" MULTIPLE size="5"
onChange="document.DemoForm.submit();">
<OPTION Value="NONE">-- choose a Region--
<% For cnum = 0 To UBound(catRows,2) %>
<OPTION Value="<%= catRows(0,cnum) %>|<%= catRows(1,cnum) %>"
<% If catRows(0,cnum) = Chr(catChosen) Then %>
SELECTED
<% End If %>
><%= catRows(1,cnum) %>
<% Next %>
</SELECT>
<SELECT Name="SubcategorySelect" MULTIPLE Size="5"
onChange="document.DemoForm.submit();">
<% If showSubcat = false Then %>
<OPTION Value="NONE">-- no State yet --
<% Else %>
<OPTION Value="NONE">-- choose a Country--
<% For cnum = 0 To UBound(subRows,2) %>
<OPTION Value="<%= subRows(0,cnum) %>|<%= subRows(2,cnum) %>"
<% If subRows(0,cnum) = Chr(sub2catChosen) Then %>
SELECTED
<% End If %>
><%= subRows(2,cnum) %>
<% Next %>
<% End If %>
</SELECT>
<SELECT Name="Sub2categorySelect" MULTIPLE Size="5"
onChange="document.DemoForm.submit();">
<% If showSub2cat = false Then %>
<OPTION Value="NONE">-- no Station yet --
<% Else %>
<OPTION Value="NONE">-- choose a City --
<% For cnum = 0 To UBound(sub2Rows,2) %>
<OPTION Value="<%= sub2Rows(0,cnum) %>|<%= sub2Rows(3,cnum) %>"
<% If sub2Rows(0,cnum) = Chr(sub3catChosen) Then %>
SELECTED
<% End If %>
><%= sub2Rows(3,cnum) %>
<% Next %>
<% End If %>
</SELECT>
<Input Type="hidden" Name="CategorySelectOld" Value="<%=Request("CategorySelect")%>">
<Input Type="hidden" Name="subCategorySelectOld" Value="<%=Request("subCategorySelect")%>">
</FORM>
<%
If ShowDisplay=True then
Response.Write (" <FONT color='red' >Welcome to " & MyCity & "," & MyCountry & " in " & MyRegion & "</FONT> <br>")
End if
%>
</BODY>
</HTML>
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.