Author |
Topic |
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 24 December 2004 : 18:34:54
|
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" |
|
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 24 December 2004 : 18:37:48
|
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 |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 24 December 2004 : 18:43:04
|
no i tried to in the last post but i got confused |
http://www.xcalliber.com - The Future of Boards |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
DarkDrift
Junior Member
USA
126 Posts |
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 24 December 2004 : 19:03:58
|
like "', '" and then for numbers it is ", '" ?
|
http://www.xcalliber.com - The Future of Boards |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
DarkDrift
Junior Member
USA
126 Posts |
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 24 December 2004 : 19:16:08
|
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 |
|
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 25 December 2004 : 12:05:36
|
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 |
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 25 December 2004 : 17:48:22
|
The error says you have a different number of column names vs. values.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
|
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 27 December 2004 : 20:13:06
|
well many people have looked it over and cannot figure this out? |
http://www.xcalliber.com - The Future of Boards |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 28 December 2004 : 07:12:59
|
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\-_ |
|
|
Topic |
|
|
|