Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ODBC Error 80040e10 - can’t find the prob
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ODBC Error 80040e10 - can’t find the prob

 Post Reply Post Reply Page  12>
Author
ladyborg View Drop Down
Newbie
Newbie


Joined: 26 February 2003
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ladyborg Quote  Post ReplyReply Direct Link To This Post Topic: ODBC Error 80040e10 - can’t find the prob
    Posted: 26 February 2003 at 10:31am

Hi,

I have a db driven page and am getting the following error: 

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The area of code in question reads:

<%

set cmdMsg = Server.CreateObject("ADODB.Command")
cmdMsg.ActiveConnection = MM_cnTOforum_STRING
cmdMsg.CommandText = "UPDATE MESSAGES  SET MSG_READ_COUNT  = MSG_READ_COUNT + 1  WHERE MSG_ID = varID "
cmdMsg.CommandType = 1
cmdMsg.CommandTimeout = 0
cmdMsg.Prepared = true
cmdMsg.Execute()

%>

I know this error pertains to a missing or mistyped field name in the db, but everything is typed correctly.

Help!

Back to Top
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 12:17pm

cmdMsg.CommandText = "UPDATE MESSAGES  SET MSG_READ_COUNT  = " & MSG_READ_COUNT + 1  & " WHERE MSG_ID = varID "

That is asssuming MSG_READ_COUNT is in fact a variable which is defined/dserived further up the page.

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 12:35pm
i assume "varID" is some sort of variable in ASP... if it is, your syntax is all wrong

cmdMsg.CommandText = "UPDATE MESSAGES SET MSG_READ_COUNT = MSG_READ_COUNT + 1 WHERE MSG_ID = " & varID
Contribute to the working anarchy we fondly call the Internet
Back to Top
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 12:36pm

Oops - I missed that one.

 

Back to Top
ladyborg View Drop Down
Newbie
Newbie


Joined: 26 February 2003
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ladyborg Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 12:48pm

Thank you so much for the help, I'm a newbie at this.

I made the &varID change, now I get the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'MSG_ID ='.

 

Back to Top
ladyborg View Drop Down
Newbie
Newbie


Joined: 26 February 2003
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ladyborg Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 12:49pm

Should that be

"&varID"

instead of "&varID

?

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 12:54pm
why do you think that?

you need to answer that question first... because you could go back and forth all day with people on the forums trying to teach you that you are trying to build a SQL string, and having varID in quotes tells ASP to take that literally, not "replace with the value of the variable"

and if you don't have that variable assigned anywhere, you are going to through that error.....
Contribute to the working anarchy we fondly call the Internet
Back to Top
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2003 at 2:39pm

This should do the trick (hopefully).....

cmdMsg.CommandText = "UPDATE MESSAGES  SET MSG_READ_COUNT  = " & MSG_READ_COUNT + 1  & " WHERE MSG_ID = " & varID

If varID is text rather than numeric (integer) then use this.....

cmdMsg.CommandText = "UPDATE MESSAGES  SET MSG_READ_COUNT  = " & MSG_READ_COUNT + 1  & " WHERE MSG_ID = '" & varID & "'"

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.