Sql Update Error

This is a discussion on "Sql Update Error" within the Classic ASP section. This forum, and the thread "Sql Update Error are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 17th, 2003, 21:42
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Sql Update Error

Using ASP - FP2000 - SQL2K

I'm trying to update a table field with info selected by the user. Below is the Code being used and the error msg generated. The code below is "Case Select" and is a work in progress. The info is text, and has a .jpg or .gif extension. What I would also like to accomplish is to set the path to this file: ie: /Absoluteig/Gallery/"SelectedFile".

<%

'get key

ID = request.querystring("ID")
Choice = request.querystring("Choice")
Image = request.querystring("Image")

' Declare our variable
Dim iChoice

' Read in the choice the user clicked on.
' This will equal "" (an empty string) if no choice is there
' Choice 1 = Members
' Choice 2 = Obituary
' Choice 3 = Memorials

Set RS = Server.CreateObject("ADODB.Recordset")
set myConn = Server.CreateObject("ADODB.Connection")



iChoice = Request.QueryString("choice")
tkey = ID
' Execute the appropriate branch based upon the value of the variable we just read in.
Select Case iChoice
Case "1"
myConn.Open xDb_Conn_Str

newSQL = "Update Business SET Background=("&Image&") Where ID=" & tkey
myConn.Execute(newSQL),,adexecutenorecords


myConn.close
set myConn=nothing

If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
Else
response.redirect "../business/businessview.asp"
End If


Case "2"
response.redirect
Case "3"

Case Else
response.redirect "Obituaryedit.asp"
' This actually runs the first time through when the user
' arrives at this page because the choice is blank.
End Select

%>

ERROR MSG:

Microsoft OLE DB Provider for SQL Server error '80040e14'

The column prefix 'brbk048' does not match with a table name or alias name used in the query.

/Absoluteig/BackgroundUpdate.asp, line 38


Thanks for any assistance.

Ernest

  #2 (permalink)  
Old Aug 18th, 2003, 00:02
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
( ) isn't the correct delimiter for a string, you need to using single quotes, so this:

<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">newSQL = "Update Business SET Background=("&Image&") Where ID=" & tkey
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

should be:

newSQL = "Update Business SET Background='"&Image&"' Where ID=" & tkey

- Cat
Closed Thread

Tags
sql, update, error

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Getting the &quot;Microsoft JET Database Engine error '80040e14'&quot; error. VegaLA Classic ASP 3 Jan 26th, 2008 00:12
Keep getting error message Microsoft VBScript runtime error '800a01a8' cpando1974 Classic ASP 2 Aug 7th, 2007 12:00
Update Help robukni PHP Forum 2 May 17th, 2007 06:14
Error 500 - Internal server error JasonStanley PHP Forum 3 Apr 23rd, 2007 17:56


All times are GMT. The time now is 00:00.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43