Reply
Can you help me with this error, please...
Old 02-14-2008, 11:25 AM Can you help me with this error, please...
Super Talker

Posts: 116
Could you please help me remedy this error?


Microsoft OLE DB Provider for SQL Servererror '80040e14'
Line 1: Incorrect syntax near '='. /home/reactivate.asp, line 17


I believe line 17 is: MyConn.Execute uSQL

Code:
<!--#include file="app_config.asp"-->
<!--#include file="inc_header.asp"-->
<%
MType   = Trim( request( "MType" ) )
IF MType = 0 THEN 
 sMESSAGE = sMESSAGE & "<li />You did not select a valid MEMBERSHIP TYPE"
 %><!--#include file="inc_error.asp"--><%
ELSE
 Call OPEN_DB()
 
 '// UPDATE USER ACCOUNT STATUS ( to Unpaid Account )
 uSQL = "UPDATE mms_tbl_user " &_
     "SET fldSTATUS = '" & Cstr(drpSTATUS(5)) & "' " &_
     "WHERE ID = " & session( "sUSER_ID" ) 
 MyConn.Execute uSQL
 dSQL = "DELETE from mms_tbl_user_membershipType " &_
     "WHERE fldUSER_ID = " & session( "sUSER_ID" ) 
 MyConn.Execute dSQL
 
 cSQL = "DELETE from mms_tbl_user_cate " &_
     "WHERE fldUSER_ID = " & session( "sUSER_ID" ) 
 MyConn.Execute cSQL
 
 set cRS = MyConn.Execute( "SELECT * FROM mms_tbl_membershipType_cate WHERE fldMembershipType_ID = " & MTYPE )
 while not cRS.EOF
  MyConn.Execute( "INSERT INTO mms_tbl_user_cate (fldCATE_ID, fldUSER_ID)" &_
      "VALUES (" & cRS( "fldCATE_ID" ) & ", " & session( "sUSER_ID" ) & ")" )
 cRS.MoveNext
    wend
 '// DEFINE MEMBERSHIP LEVEL ASSIGNMENT
 mSQL = "INSERT INTO mms_tbl_user_membershipType (fldMType_ID, fldUSER_ID)" &_
     "VALUES (" & MType & ", " & session( "sUSER_ID" ) & ")" 
 MyConn.Execute mSQL
 MyConn.Close
 Set MyConn = Nothing
 Session.Timeout = 25
 Response.Redirect "_register_2.asp?p=" & PAYMENT & "&MType=" & MType
 Response.End
END IF
%>
chrisj is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 02-14-2008, 03:23 PM Re: Can you help me with this error, please...
chrishirst's Avatar
Super Moderator

Posts: 11,894
Location: Blackpool. UK
as we keep saying to you

Print the SQL string to screen and LOOK at it

If you can't work what is wrong from it, post the SQL NOT the ASP code
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-25-2008, 12:31 PM Re: Can you help me with this error, please...
Super Talker

Posts: 116
I worked through the error and have another one:

Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near '='.
/home/register_2.asp, line 80

I added:

response.write(sql)
response.end

before line 80

and this is what now shows instead of the error:

SELECT fldSINCE, fldEXPIRES, fldUNIT FROM mms_tbl_user WHERE ID =

I don't know what to do next with this information. Can you help me please?
Thanks
chrisj is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 01:11 PM Re: Can you help me with this error, please...
Skilled Talker

Posts: 97
Name: Ganesh
Quote:
Originally Posted by chrisj View Post
I worked through the error and have another one:

Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near '='.
/home/register_2.asp, line 80

I added:

response.write(sql)
response.end

before line 80

and this is what now shows instead of the error:

SELECT fldSINCE, fldEXPIRES, fldUNIT FROM mms_tbl_user WHERE ID =

I don't know what to do next with this information. Can you help me please?
Thanks
Chris,

From what i see:

Response.Redirect "_register_2.asp?p=" & PAYMENT & "&MType=" & MType


Either PAYMENT or MType is passed empty into the _register_2.asp file.

You can either add a condition to check to make sure it is not going empty or handle the empty value to a default and use it in the query.
__________________
Gather. Search. Compare. Save on Hotel and Flight Prices @ www.vtrip.info
sri_gan is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 01:33 PM Re: Can you help me with this error, please...
chrishirst's Avatar
Super Moderator

Posts: 11,894
Location: Blackpool. UK
look at the end end the printed out string!

do you see a value for ID ??

No?

good!

because neither does the SQL server
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-28-2008, 11:06 PM Re: Can you help me with this error, please...
Super Talker

Posts: 116
Thank you both for your expert conclusions.
I greatly appreciate it.

If I knew how to "add a condition to check to make sure it is not going empty or handle the empty value to a default and use it in the query" I would do it. But I don't know how to do that to remedy this.

Any help would be greatly appreciated. Feel free to contact me offline if your guidance would involve more than replying by post. Thank you.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 02-29-2008, 02:49 AM Re: Can you help me with this error, please...
chrishirst's Avatar
Super Moderator

Posts: 11,894
Location: Blackpool. UK
Code:
if [insert_variable] <> ["" for strings] then 
     do something here because it is populated
else
     do something else because it is empty
end if
the [ ... ] parts are NOT literals it is simply a placeholder for you to insert YOUR values.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-04-2008, 05:43 PM Re: Can you help me with this error, please...
Super Talker

Posts: 116
Thanks for your help. i appreciate it.
chrisj is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can you help me with this error, please...
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 2.05399 seconds with 13 queries