Author |
Topic |
OneWayMule
Dev. Team Member & Support Moderator
Austria
4969 Posts |
Posted - 25 August 2003 : 13:29:06
|
Replace the following code (lines 57-61):
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, Chall_spot, DEFENDER, Def_spot, SCENARIO, EQUIP,"
if strStartDate <> "" then strSql = strSql & "START_DATE") VALUES &_
"('" & request.form("TYPE") & "','" & request.form("CHALLENGER") & "','" & thisChallenger("ladder_spot") & "'" &_
"'" & request.form("DEFENDER") & "','" & thisDefender("ladder_spot") & "','" & request.form("SCENARIO") & "','" & thisEQUIP("EQUIP") & "',"
if strStartDate <> "" then strSql = strSql & "#" & request.form("START_DATE") & "#"');"
with the following code:
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, CHALL_SPOT, DEFENDER, DEF_SPOT, SCENARIO, EQUIP"
if strStartDate <> "" then strSql = strSql & ", START_DATE"
strSql = strSql & ") VALUES " & _
"('" & request.form("TYPE") & "', '" & request.form("CHALLENGER") & "', '" & thisChallenger("ladder_spot") & "'" &_
"'" & request.form("DEFENDER") & "', '" & thisDefender("ladder_spot") & "', '" & request.form("SCENARIO") & "', '" & thisEQUIP("EQUIP") & "',"
if strStartDate <> "" then strSql = strSql & "'#" & request.form("START_DATE") & "#"'"
strSql = strSql & ");"
|
My MODs: Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch
Useful stuff: Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
|
|
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 25 August 2003 : 14:46:20
|
Did. What the response.write strSql showed was this: quote:
INSERT INTO GAMES (TYPE, CHALLENGER, CHALL_SPOT, DEFENDER, DEF_SPOT, SCENARIO, EQUIP, START_DATE) VALUES ('Ladder Duel', 'Alpha Wolf', '41''Avenger', '6', 'Advance on St Lo', 'SSI','#7/7/01#);
which seems just fine. But when I took out the response.write I got an error again: quote: Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in string in query expression ''#7/7/01#);'. /BG/forums/Admin_Games_AddGame_handler.asp, line 74
(line 74 is the execute line) |
Alfred The Battle Group CREDO
|
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 25 August 2003 : 15:38:26
|
Changed that, and it response.writes this now (new data): quote: INSERT INTO GAMES (TYPE, CHALLENGER, CHALL_SPOT, DEFENDER, DEF_SPOT, SCENARIO, EQUIP, START_DATE) VALUES ('Ladder Duel', 'Avenger','6',''Rommel','1','Anzio (1944)','RSF','#7/7/01#')
But without response.end it still gives the error: quote: Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error (missing operator) in query expression '''Rommel','1','Anzio (1944)','RSF','#7/7/01#')'. /BG/forums/Admin_Games_AddGame_handler.asp, line 74
txt file: http://www.ggholiday.com/bg/forums/admin_games_addgame_handler.txt
Why would the Defender (Rommel) have a " before the name instead of '? |
Alfred The Battle Group CREDO
|
Edited by - Alfred on 25 August 2003 15:41:58 |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 25 August 2003 : 16:29:02
|
you are generating a single quote after this code:
'" & thisChallenger("ladder_spot") & "','" &_
then adding one in before this code on the next line:
"'" & request.form("DEFENDER") & "','"
remove either one to fix the problem. Seriously, these typos won't occur so easily if your code is lay out correctly, take my advice.
|
Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod "In war, the victorious strategist only seeks battle after the victory has been won" |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 25 August 2003 : 16:35:02
|
Consider again this revised code for lines 60 - 80:
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, CHALL_SPOT, DEFENDER, DEF_SPOT, SCENARIO, EQUIP"
if strStartDate <> "" then
strSql = strSql & ", START_DATE"
end if
strSql = strSql & ") VALUES (" & _
"'" & request.form("TYPE") & "'," & _
"'" & request.form("CHALLENGER") & "'," & _
"'" & thisChallenger("ladder_spot") & "'," & _
"''" & request.form("DEFENDER") & "'," & _
"'" & thisDefender("ladder_spot") & "'," & _
"'" & request.form("SCENARIO") & "'," & _
"'" & thisEQUIP("EQUIP") & "'," & _
if strStartDate <> "" then
strSql = strSql & "'#" & request.form("START_DATE") & "#'"
end if
strSql = strSql & ")" how easy it would be to see if there was an extra quote in there now? (there is, its red) |
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 25 August 2003 16:39:31 |
|
|
Alfred
Senior Member
USA
1527 Posts |
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 25 August 2003 : 18:05:20
|
Yes. Now I got this: quote: Error Type: Microsoft JET Database Engine (0x80040E14) Extra ) in query expression 'M_NAME = 'Rommel') VALUES ('Ladder Duel','Avenger','6','Rommel','1','Anzio (1944)','RSF','#7/7/01#')'. /BG/forums/Admin_Games_AddGame_handler.asp, line 72
Funny thing is if I take out the "extra )" the error states "missing )"! SO what to do? |
Alfred The Battle Group CREDO
|
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 25 August 2003 : 18:26:07
|
Are you sure the current text file is the same as your ASP file ?? ... I can't even see the INSERT INTO GAMES any more.
Can you do what you were doing before ?? .. EVERY time you post include a txt link, the Response.WRite output and the error you are getting. PLEASE include all 3 in every post. |
|
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 25 August 2003 : 18:41:33
|
Yes, they are the same, but I just noticed now that I missed to copy the first line od D3mon's code, which is the "INSERT INTO GAMES" part! txt file: http://www.ggholiday.com/bg/forums/admin_games_addgame_handler.txt response.write output I can't get now, but this error instead:
quote: Error Type: Microsoft VBScript compilation (0x800A03EA) Syntax error /BG/forums/Admin_Games_AddGame_handler.asp, line 69 if strStartDate <> "" then
|
Alfred The Battle Group CREDO
|
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 25 August 2003 : 18:48:33
|
AT the end of line 67 remove this
& _
so line 67 should now look like :
"'" & thisEQUIP("EQUIP") & "'," |
|
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 25 August 2003 : 19:13:28
|
Done.
response.write strSql: quote: INSERT INTO GAMES (TYPE, CHALLENGER, CHALL_SPOT, DEFENDER, DEF_SPOT, SCENARIO, EQUIP, START_DATE) VALUES ('Ladder Duel','Avenger','6','Rommel','1','Anzio (1944)','RSF','#7/7/01#'
new error:quote: Error Type: Microsoft JET Database Engine (0x80040E07) Data type mismatch in criteria expression. /BG/forums/Admin_Games_AddGame_handler.asp, line 78
[/quote]txt file: http://www.ggholiday.com/bg/forums/admin_games_addgame_handler.txt |
Alfred The Battle Group CREDO
|
Edited by - Alfred on 25 August 2003 19:19:44 |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 25 August 2003 : 19:28:20
|
Alfred, look at the response.write ... see what's missing? Also, you have single quotes are your date fields ... single quotes are used only for text values.
However, when I look at your text file, I don't see how you are even getting a response.write as you've commented it out. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
Edited by - Nikkol on 25 August 2003 19:29:20 |
|
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 25 August 2003 : 19:50:14
|
No, Nikkol, I can't see what's missing - there are 8 fields, and 8 variables. I commented the response.write only after I ran it, so I could see the error msg. Anyway, taking out the single quotes around the date variable did finally peoduce the desired result! I think I had tried that before, since I remember similar "data type mismatch" problems from the past. There were probably other things wrong then as well, and I try to always change one thing at a time only. Thanks a lot - this was a stubborn one! |
Alfred The Battle Group CREDO
|
|
|
Topic |
|
|
|