Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 INSERT INTO ERROR 8004e14
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  16:55:13  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/dev/sprucecreek/post.asp, line 119

I am trying to let a user do something in comparison to post. here is the code from line 83 to 122 line 119 is the execute statement...


		set rsREGdoit=Server.Createobject("ADODB.Connection")
		rsREGdoit.open(strConnString)
		'## FORUM_SQL
Function lString(string)
	 if string = "" then string = " "
	 lString = Replace(string, "'", "''")
End Function
	strSql = "INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, State, City, User, link, WEBLINK, STARS ) values ('"
	strSql = StrSql & lString(Request.Form("CATID")) & "', '"
	strSql = StrSql & lString(Request.Form("FORUMID")) & "', '"
	strSql = StrSql & lString(Request.Form("TSTATUS")) & "', '"
	strSql = StrSql & lString(Request.Form("TMAIL")) & "', '"
	strSql = StrSql & lString(Request.Form("TSUBJECT")) & "', '"
	strSql = StrSql & lString(Request.Form("TMESSAGE")) & "', '"
	strSql = StrSql & lString(Request.Form("TAUTHOR")) & "', '"
	strSql = StrSql & lString(Request.Form("TREPLIES")) & "', '"
	strSql = StrSql & lString(Request.Form("TUREPLIES")) & "', '"
	strSql = StrSql & lString(Request.Form("TVIEWCOUNT")) & "', '"
	strSql = StrSql & lString(Request.Form("TLASTPOST")) & "', '"
	strSql = StrSql & lString(Request.Form("TDATE")) & "', '"
	strSql = StrSql & lString(Request.Form("TLASTPOSTER")) & "', '"
	strSql = StrSql & lString(Request.Form("TIP")) & "', '"
	strSql = StrSql & lString(Request.Form("TLASTPOSTAUTHOR")) & "', '"
	strSql = StrSql & lString(Request.Form("TLASTPOSTREPLYID")) & "', '"
	strSql = StrSql & lString(Request.Form("TARCHIVEFLAG")) & "', '"
	strSql = StrSql & lString(Request.Form("TLASTEDIT")) & "', '"
	strSql = StrSql & lString(Request.Form("TLASTEDITBY")) & "', '"
	strSql = StrSql & lString(Request.Form("TSTICKY")) & "', '"
	strSql = StrSql & lString(Request.Form("STATE")) & "', '"
	strSql = StrSql & lString(Request.Form("CITY")) & "', '"
	strSql = StrSql & lString(Request.Form("USER")) & "', '"
	strSql = StrSql & lString(Request.Form("LINK")) & "', '"
	strSql = StrSql & lString(Request.Form("WEBLINK")) & "', '"
	strSql = StrSql & lString(Request.Form("STARS")) & "')"
		
		rsREGdoit.execute(strSql)
	
		rsREGdoit.close
		set rsREGdoit = nothing


If you guys want to see the error first hand goto. http://www.jottswebhosting.com/dev/sprucecreek/post.asp?mode=userpost
i have pre-filled in the inputs just click submit... Please don't change the inputs or stuff may happen.. i dunno what...lol... Thanx for any help..
BTW i am including the file config.asp and inc_header_short in the whole file....

http://www.xcalliber.com - The Future of Boards

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  17:24:50  Show Profile  Visit D3mon's Homepage
replace the line: rsREGdoit.execute(strSql)
with: response.write strSql : response.end then post the result


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  17:28:29  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, State, City, User, link, WEBLINK, STARS ) values ('1', '1', '1', '0', ' ', 'tes12421, joppatowne, darkdrift', '1', '0, 1', '0', '0', '2004', '2004', '0', '000.000.000.000', '1', '0', '1', ' ', ' ', '0', ' ', ' ', ' ', 'null', 'www.jottswebhosting.com', '0')

http://www.xcalliber.com - The Future of Boards

Edited by - DarkDrift on 24 December 2004 17:44:51
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  17:34:11  Show Profile  Visit D3mon's Homepage
OK, try surrounding the column names state, city, user, and link with [ ] like:

strSql = "INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, [State], [City], [User], [link], WEBLINK, STARS ) values ('"


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  17:44:27  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Nothing... should i do it to the rest cause that looks bad by that i mean ', 'tes12421, joppatowne, darkdrift', see no quotes on test1221 joppatowne or darkdrift

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  17:46:33  Show Profile  Visit D3mon's Homepage
isnt that meant to be all one string? If not, then yes, each entry should have single quotes surroung it - if it is text-based. Numbers don't need the quotes.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 24 December 2004 17:50:36
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  17:55:58  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
it's both :)

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  17:57:51  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
I put [] around every one of them and i get this
INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, State, City, User, link, WEBLINK, STARS ) values (' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ')

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  17:59:16  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Here is the whole file if it helps any

<!--#INCLUDE file="complete/config.asp" -->
<!--#INCLUDE file="inc_header_short.asp" -->
<%

'DB math
'my_conn.execute ("update FORUM_MEMBERS set M_POSTS = M_POSTS-1 where MEMBER_ID = " & intMemberID)
'DB UPDATE
'my_conn.execute("update FORUM_MEMBERS set M_STATUS = " & request.form("status") & ", M_WHATEVER = " & request.form("other_value"))

if Request.QueryString("city")  <>  "" and IsNumeric(Request.QueryString("city")) = True then
	intCityID = cLng(Request.QueryString("city"))
else
	intCityID = 0
end if
select case Request.QueryString("mode")

	CASE "userpostdoit"
'		'## Forum_SQL
'		strSql = "SELECT * "
'		strSql = strSql & " FROM FORUM_MEMBERS "
'
'		Set rsCHECK = my_Conn.execute(strSql)
'dim error1
'dim error2
'dim error3
'dim error4
'dim error11
'dim error22
'dim error33
'dim error44
'
'if rsCHECK("M_NAME") = Request.Form("username") then
'error1="Username already in use please try another"
'else
'error1=""
'end if
'
'if rsCHECK("M_EMAIL") = Request.Form("email") then
'error2="Email Address already in use please try another"
'else
'error2=""
'end if
'
'if rsCHECK("M_FIRSTNAME") = Request.Form("firstname") then
'error3="First name already in use please try another"
'else
'error3=""
'end if
'
'if rsCHECK("M_LASTNAME") = Request.Form("lastname") then
'error4="Last name already in use please try another"
'else
'error4=""
'end if
'
'if Request.Form("username") = "" then
'error11="You must enter a Username"
'else
'error11=""
'end if
'
'if Request.Form("email") = "" then
'error22="You must enter a e-mail address"
'else
'error22=""
'end if
'
'if Request.Form("firstname") = "" then
'error33="You must enter a first name"
'else
'error33=""
'end if
'
'if Request.Form("lastname") = "" then
'error44="You must enter a last name"
'else
'error44=""
'end if
	'	rsCHECK.close
		'set rsCHECK = nothing
'
'if error1 = "" and error2 = "" and error3 = "" and error4 = "" and error11 = "" and error22 = "" and error33 = "" and error44 = "" then

		set rsREGdoit=Server.Createobject("ADODB.Connection")
		rsREGdoit.open(strConnString)
		'## FORUM_SQL
Function lString(string)
	 if string = "" then string = " "
	 lString = Replace(string, "'", "''")
End Function
	strSql = "INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, State, City, User, link, WEBLINK, STARS ) values ('"
	strSql = StrSql & lString(Request.Form("[CATID]")) & "', '"
	strSql = StrSql & lString(Request.Form("[FORUMID]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TSTATUS]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TMAIL]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TSUBJECT]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TMESSAGE]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TAUTHOR]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TREPLIES]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TUREPLIES]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TVIEWCOUNT]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TLASTPOST]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TDATE]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TLASTPOSTER]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TIP]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TLASTPOSTAUTHOR]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TLASTPOSTREPLYID]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TARCHIVEFLAG]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TLASTEDIT]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TLASTEDITBY]")) & "', '"
	strSql = StrSql & lString(Request.Form("[TSTICKY]")) & "', '"
	strSql = StrSql & lString(Request.Form("[STATE]")) & "', '"
	strSql = StrSql & lString(Request.Form("[CITY]")) & "', '"
	strSql = StrSql & lString(Request.Form("[USER]")) & "', '"
	strSql = StrSql & lString(Request.Form("[LINK]")) & "', '"
	strSql = StrSql & lString(Request.Form("[WEBLINK]")) & "', '"
	strSql = StrSql & lString(Request.Form("[STARS]")) & "')"
		
		rsREGdoit.execute(strSql)
		'response.write(strsql)
	
		rsREGdoit.close
		set rsREGdoit = nothing
'else
'response.write("<center>")
'response.write("<br>" & error1)
'response.write("<br>" & error2)
'response.write("<br>" & error3)
'response.write("<br>" & error4)
'response.write("<br>" & error11)
'response.write("<br>" & error22)
'response.write("<Br>" & error33)
'response.write("<Br>" & error44)
'response.write("<FORM><INPUT TYPE=""button"" VALUE=""< < Go Back and correct"" onClick=""history.go(-1)""></FORM></center>")
'end if

	case "userpost"
		'## Forum_SQL
%>
<center>Please Provide all information<br><b>I have pre-filled the lines in if you are helping me with the error...</b></center>
<br><br><table align="center" width="60%"><tr><td>
<form action="post.asp?mode=userpostdoit" method="post">
<input type="hidden" value="1" name="CATID" size="20"><br>
<input type="hidden" value="1" name="FORUMID" size="20"><br>
<input type="hidden" value="1" name="TSTATUS" size="20"><br>
<input type="hidden" value="0" name="TMAIL" size="20"><br>
<!-- Subject:<input type="text" name="TSUBJECT" size="20"><br>
Message:<input type="text" name="TMESSAGE" size="20"><br>
-->
Message:<input type="text" value="tes12421" name="TMESSAGE" size="20"><br>
Subject:<input type="text" value="joppatowne" name="TMESSAGE" size="20"><br>
<%
'Response.Write("<p>Member ID:</p><input type=""text"" value=""" & MEMBERID & """ name=""TAUTHOR"" >")
%>
<input type=""hidden value="1" name="TAUTHOR" size="20">
<input type="hidden" value="0" name="TREPLIES" size="20">
<input type="hidden" value="0" name="TUREPLIES" size="20">
<input type="hidden" value="0" name="TVIEWCOUNT" size="20">
<input type="hidden" value="2004" name="TLASTPOST" size="20">
<input type="hidden" value="2004" name="TDATE" size="20">
<input type="hidden" value="0" name="TLASTPOSTER" size="20">
<input type="hidden" value="000.000.000.000" name="TIP" size="20">
<input type="hidden" value="1" name="TLASTPOSTAUTHOR" size="20">
<input type="hidden" value="0" name="TLASTPOSTREPLYID" size="20">
<input type="hidden" value="1" name="TARCHIVEFLAG" size="20">
<input type="hidden" value="" name="TLASTEDIT" size="20">
<input type="hidden" value="" name="TLASTEDITBY" size="20">
<input type="hidden" value="0" name="TSTICKY" size="20">
<!--
State ID:<input type="text" name="STATE" size="20"><br>
City ID:<input type="text" name="CITY" size="20"><br>
-->
State ID:<input type="text" value="1" name="STATE" size="20"><br>
City ID:<input type="text" value="1" name="CITY" size="20"><br>
<%
'Response.Write("<p>User</p><input type=""text"" value=""" & StrDBNTUserName & """ name=""USER"" size=""20""><br>")
%>
User:<input type="text" value="darkdrift" name="TMESSAGE" size="20"><br>
<!--
Image:<input type="text" name="LINK" size="20"><br>
Website:<input type="text" name="WEBLINK" size="20"><br>
Stars:<input type="text" name="STARS" size="20"><br>
<input type="hidden" name="TREPLIES" value="1">
-->
Image:<input type="text" value="null" name="LINK" size="20"><br>
Website:<input type="text" value="www.jottswebhosting.com" name="WEBLINK" size="20"><br>
Stars:<input type="text" value="0" name="STARS" size="20"><br>
<input type="hidden" name="TREPLIES" value="1">
<input type="submit" value="Submit">
</td></tr></table>
<%
		
end select
%>

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  18:13:56  Show Profile  Visit D3mon's Homepage
no no, not inside the request.form part but inside the first part of the SQL string like this:

strSql = "INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, [State], [City], [User], [link], WEBLINK, STARS ) values ('"


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 24 December 2004 18:14:10
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  18:21:44  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
lol :) let me try that then...Oops

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  18:25:26  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
i updated it and i got this

Microsoft JET Database Engine error '80040e14'

The INSERT INTO statement contains the following unknown field name: 'CAT_ID'. Make sure you have typed the name correctly, and try the operation again.

/dev/sprucecreek/post.asp, line 119
I did this to my code:

"INSERT INTO FORUM_MEMBERS ([CAT_ID], [FORUM_ID], [T_STATUS], [T_MAIL], [T_SUBJECT], [T_MESSAGE], [T_AUTHOR], [T_REPLIES], [T_UREPLIES], [T_VIEW_COUNT], [T_LAST_POST], [T_DATE], [T_LAST_POSTER], [T_IP], [T_LAST_POST_AUTHOR], [T_LAST_POST_REPLY_ID], [T_ARCHIVE_FLAG], [T_LAST_EDIT], [T_LAST_EDITBY], [T_STICKY], [State], [City], [User], [link], [WEBLINK], [STARS] ) values ('"


EDIT:
i did what you said also:

strSql = "INSERT INTO FORUM_MEMBERS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, [State], [City], [User], [link], WEBLINK, STARS ) values ('"


and got the same error

http://www.xcalliber.com - The Future of Boards

Edited by - DarkDrift on 24 December 2004 18:27:32
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  18:26:50  Show Profile  Visit D3mon's Homepage
OK, so does your database table FORUM_MEMBERS have a column named CAT_ID? (mine doesn't)


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 24 December 2004 18:28:52
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  18:28:09  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Holy crap... It is suppost to be FORUM_TOPICS....lol..let me try that

http://www.xcalliber.com - The Future of Boards
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  18:29:19  Show Profile  Visit D3mon's Homepage
Ah!


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  18:30:34  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Now i get this error when i changed it to FORUM_TOPICS


Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/dev/sprucecreek/post.asp, line 119


Line 119 is the execute statement

http://www.xcalliber.com - The Future of Boards
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07