Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2004, 07:51 PM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft JET Database Engine error '80040e14'

Can anyone advise me how could i solve this problem??? I got the below error msg when i try running my script

[u]ERROR</u>
UPDATE [Users] SET [uEmail] = '[email protected]', [RealName] = 'qwer', [uAge] = '12', [Gender] = '1', [uContact] = '', [uModel] = '', [uPlate] = '', [location] = '', [website] = '', [icq] = '', [msn] = '', [aol] = '', [yahoo] = '', [interests] = '', [sig] = ' ', [Avatar] = '', [HideEmail] = 'False', WHERE uID = 14
Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/revolnip/Discussion/UpdateProfile.asp, line 99


[u]SCRIPT</u>
<% Dim profile, rsUsers, pdon, apos, elen, postContent, postSubject, topic, avatar, abortUpdate, img, i, rsForums
if not intUID = 0 then Conn.Execute("UPDATE [Users] SET [LastActivePlace] = ""profile.asp?profile=" & Request("profile") & """, [LastLoggedIn]= now(), [IP] = '" & GetIP & "' WHERE [uID]=" & intUID)

if intUID <> 0 then 'if someone has requested a profile
    Set rsUsers = Conn.Execute("SELECT * From [Users] WHERE [uID] = " & intUID)
Else
    Set Conn = nothing
    rsUsers.close

    response.redirect "default.asp"
end if

If Request("update") = "true" then

function FormatString(x)
    x = replace(x, "'", "''")
    'x = replace(x, """", """""")
    x = Replace(x, "<", "&lt;")
    x = Replace(x, ">", "&gt;")
    x = Replace(x, vbCrLf, "<br>")
    FormatString = x
end function

'get data, validate it
    dim strSQL, dbpass, email, RealName, uage, Gender, uContact, uModel, uPlate, location, website, aol, icq, msn, yahoo, interests, sig, HideEmail
    email = Replace(Request("email"), "'", "''")
    if len(email) < 6 then elen = true
    if instr(email, "@") = 0 then elen = true
    'response.write instr("asd", "@") & " : " & instr("asd@asd", "@")
    realname = FormatString(Request("realname"))
    uage = FormatString(Request("uage"))
    gender = FormatString(Request("Gender"))
    uContact = FormatString(Request("uContact"))
    uModel = FormatString(Request("uModel"))
    uPlate = FormatString(Request("uPlate"))
    location = FormatString(Request("location"))
    website = FormatString(Request("website"))
    If len(website) > 1 then
        If lCase(Left(website, 4)) <> "http" then website = "http://" & website
    End If
    aol = FormatString(Request("aol"))
    icq = FormatString(Request("icq"))
    msn = FormatString(Request("msn"))
    yahoo = FormatString(Request("yahoo"))
    interests = FormatString(Request("interests"))
    sig = Request("sig")
    postContent = sig
    Set rsForums = Conn.Execute("SELECT General.*, PER_TEMPLATE.* From [General] INNER JOIN PER_TEMPLATE ON General.PER" & intGroup & " = PER_TEMPLATE.TEMPLATE_ID") 'should hopefully stop errors occuring in formatpost.asp
    dim POST_HTML, POST_BB, POST_SMILIE, POST_IMG
    POST_HTML = false
    POST_BB = true
    POST_SMILIE = true
    POST_IMG = true
    %>

    <%
    sig = postContent

    avatar = FormatString(Request("avatar"))
    HideEmail = Request("hideemail")
    if HideEmail = "true" then HideEmail = true else HideEmail = false

'update record
    if not abortUpdate = true then 'if all good then
        strSQL = "UPDATE [Users] SET "
        if not elen = true then
            strSQL = strSQL & "[uEmail] = '" & email & "', "
        end if
        strSQL = strSQL & "[RealName] = '" & realname & "', "
        strSQL = strSQL & "[uAge] = '" & uage & "', "
        strSQL = strSQL & "[Gender] = '" & gender & "', "
        strSQL = strSQL & "[uContact] = '" & uContact & "', "
        strSQL = strSQL & "[uModel] = '" & uModel & "', "
        strSQL = strSQL & "[uPlate] = '" & uPlate & "', "
        strSQL = strSQL & "[location] = '" & location & "', "
        strSQL = strSQL & "[website] = '" & website & "', "
        strSQL = strSQL & "[icq] = '" & icq & "', "
        strSQL = strSQL & "[msn] = '" & msn & "', "
        strSQL = strSQL & "[aol] = '" & aol & "', "
        strSQL = strSQL & "[yahoo] = '" & yahoo & "', "
        strSQL = strSQL & "[interests] = '" & interests & "', "
        strSQL = strSQL & "[sig] = '" & sig & "', "

    if Application("AV_ENABLED") = true then
        strSQL = strSQL & "[Avatar] = '" & avatar & "', "
    end if
        strSQL = strSQL & "[HideEmail] = '" & HideEmail & "', "
        strSQL = strSQL & "WHERE uID = " & intUID
        Response.Write (strSQL)
        Conn.Execute (strSQL)
    end if
end if
rsUsers.Requery

intOffSet = rsUsers("Offset")
%>


 
Old August 30th, 2004, 08:30 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,

  You try to print the strSQL and see how it was formed. I think, there is a comma after the lat field based on your condition.

Means, strSQL="UPDATE users SET fld1=" & val1 & ",fld2=" & val2 & ", where ..."



 
Old August 30th, 2004, 11:05 PM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

so r u telling me tat i should actually remove the last commas??

I still got error :

UPDATE [Users] SET [uEmail] = '[email protected]', [RealName] = 'qwer', [uAge] = '12', [Gender] = '1', [uContact] = '', [uModel] = '', [uPlate] = '', [location] = '', [website] = '', [icq] = '', [msn] = '', [aol] = '', [yahoo] = '', [interests] = '', [sig] = ' ', [Avatar] = '', [HideEmail] = 'False' WHERE uID = 14
Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/revolnip/Discussion/UpdateProfile.asp, line 9


All my data type is text except for [HideEmail] my data type is YES/NO so what should i do?? Anything to do w/ this??

 
Old August 31st, 2004, 01:01 AM
Authorized User
 
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sinapra Send a message via MSN to sinapra Send a message via Yahoo to sinapra
Default

Is it bool/Char/int datatype description?
check that and accordingly mention the condition while retrieve the data, if its yes/no and datatype is char, you can mention [HideEmail] = 'yes/no', if its an int type, remove the quotes and give it a try.

sinapra
 
Old September 3rd, 2004, 03:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Aprnip.

Data type mismatch in criteria expression. Which means, you are missing ' around 14 in where clause.

Try this...
Code:
UPDATE [Users] SET [uEmail] = '[email protected]', 
[RealName] = 'qwer', [uAge] = '12', [Gender] = '1', [uContact] = '', 
[uModel] = '', [uPlate] = '', [location] = '', [website] = '', 
[icq] = '', [msn] = '', [aol] = '', [yahoo] = '', [interests] = '', 
[sig] = ' ', [Avatar] = '', [HideEmail] = 0 WHERE uID = '14'
Use FALSE without ' quotes if ZERO doesn't work in the above statement or try with NO.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 5th, 2004, 11:25 PM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thks. the script works now!! cheers

 
Old December 10th, 2005, 07:36 AM
Registered User
 
Join Date: Dec 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Guys... have been stuck on this problem for 4 days now.. just can't seem to solve it. And the problem seems to be an UPDATE statement. This is what the statement looks like and the error:
-------------------------------------------------------------------

Update tdPicUpload SET title='Party', desc='Shreelas 2nd birthday party.1', iso='800', sspeed='30', apature='4.5' WHERE picid ='2005123155615'
Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/_photos/uploadlist.asp, line 29

-------------------------------------------------------------------
Here is the code:
-------------------------------------------------------------------

If Trim(Request.QueryString("action")) = "validate" Then

    Call OpenDB()
    strSQLInfo = "Update tdPicUpload SET title='"& Request.Form("ftitle")&"', desc='"&Request.Form("fdesc")&"', iso='"& Request.Form("fiso")&"', sspeed='"&Request.Form("fspeed")&"', apature='"&Request.Form("fapature")&"' WHERE picid ='"&Trim(Request.QueryString("picid"))&"'"

    Response.Write(strSQLInfo)
    Set objRS = objConn.Execute(strSQLInfo,,adCmdText)
    Call CloseDB()

End If
-------------------------------------------------------------------

The error is being thrown at Set objRS = objConn.Execute(strSQLInfo,,adCmdText), and I have completely no idea why the problem is here, and why it wont go away. If anyone can find the issue, it would be really appreciated if you could email me at [email protected]. Thankyou everyone in advance.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Error: Microsoft Jet Engine asters ASP.NET 1.0 and 1.1 Professional 2 April 3rd, 2007 09:33 AM
Microsoft JET Database Engine error '80040e10' byronthurman Classic ASP Databases 5 June 8th, 2006 08:20 AM
Microsoft JET Database Engine error '80040e10' malhyp Classic ASP Databases 5 June 6th, 2006 10:07 PM
Microsoft JET Database Engine error '80040e14' aprnip Classic ASP Databases 2 November 15th, 2004 02:06 AM
Microsoft JET Database Engine error '80040e10' nvillare Classic ASP Databases 1 August 20th, 2003 12:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.