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)
 what operator is missing here?
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Alfred
Senior Member

USA
1527 Posts

Posted - 24 August 2003 :  17:38:04  Show Profile  Visit Alfred's Homepage
quote:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '''Avenger','6','Anzio (1944)','RSF',#7/7/02#)'.
/BG/forums/Admin_Games_AddGame_handler.asp, line 64

this is the faulty code:
quote:
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, DEFENDER, SCENARIO, EQUIP,"
if strStartDate <> "" then strSql = strSql & "START_DATE, "
if strEndDate <> "" then strSql = strSql & "END_DATE, "
strSql = strSql & "RESULT, VICTOR) VALUES " &_
"('" & request.form("TYPE") & "','" & request.form("CHALLENGER") & "'," &_
"'" & request.form("DEFENDER") & "','" & request.form("SCENARIO") & "','" & thisEQUIP("EQUIP") & "',"
if strStartDate <> "" then strSql = strSql & "#" & request.form("START_DATE") & "#,"
if strEndDate <> "" then strSql = strSql & "#" & request.form("END_DATE") & "#,"
strSql = strSql & "'" & request.form("RESULT") & "','" & request.form("VICTOR") & "')"
my_Conn.execute(strSql)

Alfred
The Battle Group
CREDO

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 24 August 2003 :  17:44:22  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Ummm... what are the # characters for?

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
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 August 2003 :  18:17:38  Show Profile  Visit D3mon's Homepage
Try adding in the characters in red:

if strStartDate <> "" then strSql = strSql & "'#" & request.form("START_DATE") & "#',"
if strEndDate <> "" then strSql = strSql & "'#" & request.form("END_DATE") & "#',"


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 August 2003 18:17:53
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 24 August 2003 :  18:23:43  Show Profile  Visit D3mon's Homepage
You'll find your code easier to debug if you give it some structure, for example:

strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, DEFENDER, SCENARIO, EQUIP,"

if strStartDate <> "" then
	strSql = strSql & "START_DATE, "
end if

if strEndDate <> "" then
	strSql = strSql & "END_DATE, "
end if

strSql = strSql & "RESULT, VICTOR) VALUES (" & _
	"'" & request.form("TYPE") & "'," & _ 
	"'" & request.form("CHALLENGER") & "'," & _
	"'" & request.form("DEFENDER") & "'," & _
	"'" & request.form("SCENARIO") & "'," & _
	"'" & thisEQUIP("EQUIP") & "',"

if strStartDate <> "" then
	strSql = strSql & "#" & request.form("START_DATE") & "#,"
end if

if strEndDate <> "" then
	strSql = strSql & "#" & request.form("END_DATE") & "#,"
end if

strSql = strSql & "'" & request.form("RESULT") & "'," & _
	"'" & request.form("VICTOR") & "')"

my_Conn.execute(strSql)


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 August 2003 18:24:59
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 24 August 2003 :  19:20:52  Show Profile  Visit Alfred's Homepage
quote:
Originally posted by OneWayMule

Ummm... what are the # characters for?

In Access I need to put those # characters around date field variables to make them compatible.
Also, they were part of the functional code before, and the error only came up when I added the two "ladder_spot" fields.

Alfred
The Battle Group
CREDO

Edited by - Alfred on 24 August 2003 19:27:32
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 24 August 2003 :  19:30:07  Show Profile
Alfred, you're forgetting the first rule again .... if the Execute fails, then (in this case) put a Response.Write strSql just before the Execute line. That should point you in the right direction.

D3mon's coding structure will help, but your error line will still be the Execute line.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 24 August 2003 :  21:54:11  Show Profile  Visit Alfred's Homepage
Laser, the error line (64) actually is not the execue line but the one in red:
quote:
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, DEFENDER, SCENARIO, EQUIP,"
if strStartDate <> "" then strSql = strSql & "START_DATE, "
if strEndDate <> "" then strSql = strSql & "END_DATE, "
strSql = strSql & "RESULT, VICTOR) VALUES " &_
"('" & request.form("TYPE") & "','" & request.form("CHALLENGER") & "'," &_
"'" & request.form("DEFENDER") & "','" & request.form("SCENARIO") & "','" & thisEQUIP("EQUIP") & "',"
if strStartDate <> "" then strSql = strSql & "#" & request.form("START_DATE") & "#,"
if strEndDate <> "" then strSql = strSql & "#" & request.form("END_DATE") & "#,"
strSql = strSql & "'" & request.form("RESULT") & "','" & request.form("VICTOR") & "')"
Response.Write strSql
response.end
my_Conn.execute(strSql)
I get the same error report now.

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 24 August 2003 :  22:04:18  Show Profile
it probably is having a problem with thisEQUIP("EQUIP") ... what is that?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 24 August 2003 :  22:06:46  Show Profile
however, the error that you first posted could only be from executing the sql. perhaps you should just post a link to a text version of that file.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 25 August 2003 :  00:02:47  Show Profile  Visit Alfred's Homepage
thisEQUIP("EQUIP") ... was part of the code that worked ok before I modified it.
I made a txt version:
http://www.ggholiday.com/bg/forums/admin_games_addgame_handler.txt

Alfred
The Battle Group
CREDO

Edited by - Alfred on 25 August 2003 00:04:17
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 25 August 2003 :  00:48:24  Show Profile
OK, with the code you provided, line 64 has nothing to do with an Execute or thisEQUIP.

So using the code that you have provided in the txt file, try this :

Create a new line between lines 65 and 66 and insert :

Response.Write strSql
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 25 August 2003 :  00:57:14  Show Profile  Visit Alfred's Homepage
Please disregard the original code I posted above.
It does not contain my addition (in red here):
quote:
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, Chall_spot, DEFENDER, Def_spot, SCENARIO, EQUIP,"
if strStartDate <> "" then strSql = strSql & "START_DATE, "
if strEndDate <> "" then strSql = strSql & "END_DATE, "
strSql = strSql & "RESULT, VICTOR) 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") & "#,"
if strEndDate <> "" then strSql = strSql & "#" & request.form("END_DATE") & "#,"
strSql = strSql & "'" & request.form("RESULT") & "','" & request.form("VICTOR") & "')"
my_Conn.execute(strSql)


This error msg claims:
quote:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Number of query values and destination fields are not the same.
/BG/forums/Admin_Games_AddGame_handler.asp, line 66

but I thought I added two for each side?
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 00:59:54
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 25 August 2003 :  01:07:55  Show Profile
So where is the Response.Write before the Execute ??

I can't see what is wrong with your statement, but try a ; right at the end as in :


strSql = strSql & "'" & request.form("RESULT") & "','" & request.form("VICTOR") & "');"
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 25 August 2003 :  11:11:47  Show Profile  Visit Alfred's Homepage
I did both things now, but still only get get an error msg.
Look: http://www.ggholiday.com/bg/forums/admin_games_addgame_handler.txt

Alfred
The Battle Group
CREDO
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 25 August 2003 :  11:17:59  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
quote:
I did both things now, but still only get get an error msg.

Post the exact error message please.
Also, change the red part in the following code
if strStartDate = "" and strEndDate = "" then
  response.write "<center>You need to enter a date!"
else
strSql = "INSERT INTO GAMES (TYPE, CHALLENGER, Chall_spot, DEFENDER, Def_spot, SCENARIO, EQUIP,"
if strStartDate <> "" then strSql = strSql & "START_DATE, "
if strEndDate <> "" then strSql = strSql & "END_DATE, "
strSql = strSql & "RESULT, VICTOR) 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") & "#,"
if strEndDate <> "" then strSql = strSql & "#" & request.form("END_DATE") & "#,"
strSql = strSql & "'" & request.form("RESULT") & "','" & request.form("VICTOR") & "');"
Response.Write 
'response.end
my_Conn.execute(strSql)

to
Response.Write strsql
Response.End

and post what the page displays.

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
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 25 August 2003 :  12:18:25  Show Profile  Visit Alfred's Homepage
This is what it displays:
quote:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/BG/forums/Admin_Games_AddGame_handler.asp, line 58, column 57
if strStartDate <> "" then strSql = strSql & "START_DATE") VALUES &_
--------------------------------------------------------^

Alfred
The Battle Group
CREDO
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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07