Print Page | Close Window

ASP Update Command Help!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8212
Printed Date: 01 April 2026 at 1:14am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP Update Command Help!
Posted By: rcalvert
Subject: ASP Update Command Help!
Date Posted: 19 December 2003 at 5:25am
Please could somebody give this code a once over ive been staring at it for hours it keeps producing a 80040e14 missing operator in query expression error. Many thanks in advance.

Code:


if(Session("fldFeatureID") <> "") then Command1__varFeatureID = Session("fldFeatureID")

if(Session("fldImageStatus") <> "") then Command1__varStatusChangedTo = Session("fldImageStatus")

if(Now() <> "") then Command1__varDateTime = Now()

if(Session("MM_Username") <> "") then Command1__varChangedBy = Session("MM_Username")

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_stormv2_STRING
Command1.CommandText = "INSERT INTO tblImageControlLog (fldFeatureID, fldStatusChangedTo, fldDateTime, fldChangedBy)  VALUES (" + Replace(Command1__varFeatureID, "'", "''") + ", " + Replace(Command1__varStatusChangedTo, "'", "''") + ", " + Replace(Command1__varDateTime, "'", "''") + ", " + Replace(Command1__varChangedBy, "'", "''") + ") "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()



-------------



Replies:
Posted By: MorningZ
Date Posted: 19 December 2003 at 5:35am

start off by using & not + to piece together the SQL statment (and VBScript string concatination for that matter)

 



-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net