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.
|
|
|
|
|
![]() |
||
Sql Update Error
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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 |
|
|
|
|||
|
( ) 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 |
![]() |
| Tags |
| sql, update, error |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Getting the "Microsoft JET Database Engine error '80040e14'" 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 |