|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
General - Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
i have some problem with my code about "edit" database that writes access.but bot run and error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1 Listcategory.asp: <!--#include file="../include/connection.inc"--> <% set rs=conn.execute("Select * from categories") while not rs.eof %> <tr> <th scope="row"> </th> <th scope="row"><%=rs("categoryname")%></th> <th scope="row"> <a href="FormUpdateCategories.asp?Categoryid=<%=rs("CategoryID")%>">Edit</a> </th> </tr> <% rs.movenext wend rs.close set rs=nothing conn.close set conn=nothing response.End() %> and then formupdatecaegories.asp <!--#include file="../include/connection.inc"--> <% dim id ID = trim(request.querystring("CategoryID")) Set rs=Conn.execute("SELECT * FROM categories WHERE CategoryID = "& ID) %> and it error line:Set rs=Conn.execute("SELECT * FROM categories WHERE CategoryID = "& ID) please help me to do that Thanks in advance Regrads Hoang Phuc |
|
#2
|
||||
|
||||
|
please use code tags, select code and press #.
It seems you dont have a value in ID. Also, dont store connection details in an inc file as it might not be safe, store it in an asp file. |
|
#3
|
||||
|
||||
|
--moved to the ASP forum.
|
|
#4
|
||||
|
||||
|
This error occurs in Microsoft Access when one of the column names specified in a select statement does not exist in the table being queried.
1. Check the table whether CategoryID column exists or not. 2. Check whether you have mis-spelled the column name |
|
#5
|
||||
|
||||
|
Debug it by using response.write and response.end.
sql = "SELECT * FROM categories WHERE CategoryID = "& ID response.write sql response.end Set rs=Conn.execute(sql)
__________________
My homepage - www.findingsteve.net Greatest commandment - “Teacher, which is the greatest commandment in the Law?” Jesus replied: “ ‘Love the Lord your God with all your heart and with all your soul and with all your mind.’ This is the first and greatest commandment. And the second is like it: ‘Love your neighbor as yourself.’ ” Matthew 22: 36-40 (NIV, Bible) Progress - "Sedikit-sedikit, lama-lama menjadi bukit." (Literal translation: Bit by bit, in the end it becomes a hill.) |
|
#6
|
||||
|
||||
|
another common reason for this error is if CategoryID is varchar, then
you get: SELECT * FROM categories WHERE CategoryID = A5NM1SP and of course, you don't have field named "A5NM1SP". if that's the case, wrap the value with single quotes. |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > General - Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|