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
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  18:34:54  Show Profile  Visit D3mon's Homepage
right, so now its probably saying that you supplied a string (surrounded by single quotes) where it was expecting a number (not surrounded by single quotes) in the query. Check the data coming in from the form and if it is (and should always be) a number, then remove the single quotes surrounding it - for example:

let's say TREPLIES is always a number, we can remove the quotes as follows (delete the red stuff)

strSql = StrSql & lString(Request.Form("[TAUTHOR]")) & "', '"
strSql = StrSql & lString(Request.Form("[TREPLIES]")) & "', '"


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:37:48  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
so like this:

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")) & "')"


I got confused a T_MESSAGE

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:39:45  Show Profile  Visit D3mon's Homepage
did you remove the single quotes??


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:43:04  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
no i tried to in the last post but i got confused

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:44:23  Show Profile  Visit D3mon's Homepage
ok, so is TMESSAGE text or a number?


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:54:47  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Text

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

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  19:01:42  Show Profile  Visit D3mon's Homepage
so the single quotes stay around that one.


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 :  19:03:58  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
like "', '" and then for numbers it is ", '" ?

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

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 December 2004 :  19:11:33  Show Profile  Visit D3mon's Homepage
for numbers it would be ", "


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 :  19:12:03  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
I think i got it let me test :)

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

DarkDrift
Junior Member

USA
126 Posts

Posted - 24 December 2004 :  19:16:08  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
heres the error:

Microsoft JET Database Engine error '80040e14'

Number of query values and destination fields are not the same.

/dev/sprucecreek/post.asp, line 119

and heres my code

	strsql = "INSERT INTO FORUM_TOPICS ([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")) & "')"

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

DarkDrift
Junior Member

USA
126 Posts

Posted - 25 December 2004 :  12:05:36  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
Still the mystery of the Insert INTO statement...
Does it matter if the fields are long text or integer? cause there are alot

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

Doug G
Support Moderator

USA
6493 Posts

Posted - 25 December 2004 :  17:48:22  Show Profile
The error says you have a different number of column names vs. values.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 27 December 2004 :  20:13:06  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
well many people have looked it over and cannot figure this out?

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

cripto9t
Average Member

USA
881 Posts

Posted - 28 December 2004 :  07:12:59  Show Profile


INSERT INTO forum_topics ([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,'1','1',' ','null','www.jottswebhosting.com','0')

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/dev/sprucecreek/post.asp, line 122

Remove the comments from the numbered fields
'1' should be 1
'null' should be null

You also have some blank fields, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, USER. Either remove or give them a value.
T_AUTHOR is an integer field, so text will give you a data type mismatch error. It should be the members ID not username.
Also, I'm just familiar with mySql, but the fields need a space between them.

	strSql = "INSERT INTO FORUM_TOPICS (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")) & ")"

The ones in red need values.
I'm assuming "STATE" and "CITY" are text fields. I also removed comments from around "LINK" because you have it set to null.

    _-/Cripto9t\-_
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | 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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07