SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 8th, 2008, 03:21 AM
Jens Simonsen Jens Simonsen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 Jens Simonsen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 4 sec
Reputation Power: 0
Multiple field update problem

hi there im havin a problem im trying to update multiple fields in one record but it is givin me som problems i cant find

first off this is my code for the page making the sql statement.

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="component/DB_connections.asp" -->
<%
a1 = session("typeids")
a2 = session("typeshipname1")
a3 = session("highnamefield")
a4 = session("highslotfield")
a5 = session("shipconname")
g = request.QueryString("marketgn")
x = request.QueryString("gfxid")

%>
<%
	set getmgroup=Server.CreateObject("ADODB.RecordSet")
	sql="SELECT * FROM evegraphics WHERE graphicID = '"&x&"'"
	set getmgroup = triconn.Execute(sql)
	
gfxindid = getmgroup.fields.item("icon").value

Function ReplaceQuotes(strValue)
   strValue = Replace(strValue, "'", "")

   ReplaceQuotes = strValue
End Function

a9 = ReplaceQuotes(g)
<!--- this generates the sql statement --->
IF request.Form("highname2") = "no" THEN hend1 = "" ELSE hend1 = "," END IF
IF request.Form("highname3") = "no" THEN hend2 = "" ELSE hend2 = "," END IF
IF request.Form("highname4") = "no" THEN hend3 = "" ELSE hend3 = "," END IF
IF request.Form("highname5") = "no" THEN hend4 = "" ELSE hend4 = "," END IF
IF request.Form("highname6") = "no" THEN hend5 = "" ELSE hend5 = "," END IF
IF request.Form("highname7") = "no" THEN hend6 = "" ELSE hend6 = "," END IF
IF request.Form("highname8") = "no" THEN hend7 = "" ELSE hend7 = "," END IF

IF request.Form("midname1") = "no" THEN mend8 = "" ELSE mend8 = "," END IF
IF request.Form("midname2") = "no" THEN mend1 = "" ELSE mend1 = "," END IF
IF request.Form("midname3") = "no" THEN mend2 = "" ELSE mend2 = "," END IF
IF request.Form("midname4") = "no" THEN mend3 = "" ELSE mend3 = "," END IF
IF request.Form("midname5") = "no" THEN mend4 = "" ELSE mend4 = "," END IF
IF request.Form("midname6") = "no" THEN mend5 = "" ELSE mend5 = "," END IF
IF request.Form("midname7") = "no" THEN mend6 = "" ELSE mend6 = "," END IF
IF request.Form("midname8") = "no" THEN mend7 = "" ELSE mend7 = "," END IF 
 
setsql = "UPDATE loadout SET "
IF request.Form("highname1") = "yes" Then setsql = setsql & " highname1 = '"&a9&"', highslotgfxid1 = "&gfxindid&"" & hend1 END IF
IF request.Form("highname2") = "yes" Then setsql = setsql & " highname2 = '"&a9&"', highslotgfxid2 = "&gfxindid&"" & hend2 END IF
IF request.Form("highname3") = "yes" Then setsql = setsql & " highname3 = '"&a9&"', highslotgfxid3 = "&gfxindid&"" & hend3 END IF
IF request.Form("highname4") = "yes" Then setsql = setsql & " highname4 = '"&a9&"', highslotgfxid4 = "&gfxindid&"" & hend4 END IF
IF request.Form("highname5") = "yes" Then setsql = setsql & " highname5 = '"&a9&"', highslotgfxid5 = "&gfxindid&"" & hend5 END IF
IF request.Form("highname6") = "yes" Then setsql = setsql & " highname6 = '"&a9&"', highslotgfxid6 = "&gfxindid&"" & hend6 END IF
IF request.Form("highname7") = "yes" Then setsql = setsql & " highname7 = '"&a9&"', highslotgfxid7 = "&gfxindid&"" & hend7 END IF
IF request.Form("highname8") = "yes" Then setsql = setsql & " highname8 = '"&a9&"', highslotgfxid8 = "&gfxindid&"" & mend8 END IF
<!--- generation complete --->
	
sql4=""&setsql&" WHERE shipconname = '"&a5&"' AND typeid = "&a1&""
response.Write sql4
response.end
triconn.Execute(sql4)

response.Redirect("test4.asp?type="&a1&"&shipn="&a5&"")

%>

<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
getmgroup_numRows = getmgroup_numRows + Repeat1__numRows
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ship Selection</title>
        <style type="text/css" media="screen">
        A:LINK { color:white; text-decoration:none;}
        A:VISITED { color:White; text-decoration:none;}
        A:ACTIVE { color:white; text-decoration:none;}
        A:HOVER { Color:red; }
    </style>
</head>

<body style="margin:0; padding:0; font-family:Verdana, Arial, Helvetica, sans-serif;" bgcolor="#747373" text="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="479" bgcolor="#747373" align="center">
            <tr>
                <td style="background:url(../img/cont.png); background-repeat:no-repeat; background-position:center;">
                    <div style=" width:465px; height:408px; overflow:scroll; margin-top:30px; margin-left:50px; color:White; padding-left:10px;">
                        <br />
                           <ul>
								<% 
								While ((Repeat1__numRows <> 0) AND (NOT getmgroup.EOF)) 
								%>

									<li><a href="itemselect.asp?marketg=<%=getmgroup.fields.item("marketgroupid").value%>&check=1"><%=getmgroup.fields.item("marketgroupname").value%></a></li>
								 <% 
  										Repeat1__index=Repeat1__index+1
  										Repeat1__numRows=Repeat1__numRows-1
  										getmgroup.MoveNext()
								Wend
								%>
                          </ul>
                    </div>
                </td>
            </tr>
        </table> 
</body>
</html>


Then this is the error code i get in the browser when running it.

Code:
Errortype:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]Unknown column '13_15' in 'field list'
/bsc/ind_item.asp, line 57


and this is the debug line of the sql stement with fillings :

Code:
UPDATE loadout SET highname1 = 'Mega Pulse Laser II', highslotgfxid1 = 13_15, highname2 = 'Mega Pulse Laser II', highslotgfxid2 = 13_15, highname3 = 'Mega Pulse Laser II', highslotgfxid3 = 13_15, highname4 = 'Mega Pulse Laser II', highslotgfxid4 = 13_15, highname5 = 'Mega Pulse Laser II', highslotgfxid5 = 13_15, highname6 = 'Mega Pulse Laser II', highslotgfxid6 = 13_15 WHERE shipconname = 'aramged1' AND typeid = 643


if any have some idea what is wrong with my statement pls tel me course i cant seam to figure this out i cchecked the colums in the db and ther name is corroct in the statement hence why im confused

Jens
thx in advanced

Reply With Quote
  #2  
Old April 9th, 2008, 08:36 PM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,703 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 21 h 25 m 43 sec
Reputation Power: 688
Well, the error message is telling you you have specified a non-existent column name in your sql string. Either your code is passing the wrong value or you aren't using the correct name to match your db.
__________________
======
Doug G
======
"Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton

Reply With Quote
  #3  
Old April 10th, 2008, 01:13 AM
Jens Simonsen Jens Simonsen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 Jens Simonsen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 4 sec
Reputation Power: 0
hi thx for the reply i look it over again with fresh eyes and i found out the value that was passed didn match the type of the field i had to use quetes ' ' then it worked



Jens

thx

Reply With Quote
  #4  
Old April 11th, 2008, 02:39 AM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,703 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 21 h 25 m 43 sec
Reputation Power: 688
I'm glad you got it working.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Multiple field update problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway