repro script = small
Your original post only mentioned 3 fields. Now I see 9 ... ? Are all 9
required to reproduce the problem?
How about all that html down there? Is all that stuff really needed to see
the problem occur? Get rid of everything that's not needed to see the
symptoms appear.
I also need to see what's in that include file (censor passwords of course).
I can't attempt to reproduce the problem without knowing what kind of
connection string you are using (of course, if your connection string does
not include the word "SQLOLEDB", then stop right there and read this:
http://www.aspfaq.com/show.asp?id=2126. The problem you are describing only
occurred when using ODBC if I remember correctly. Switch to the recomended
connection string and see if that solves the problem). Please include that
directly in the repro script without using an include file ... I'm sure the
use of the include file has nothing to do with your problem.
Oh, and you need to discontinue this practice (stuff like this is why most
of us react in disgust when we see someone using DW):
Recordset2_cmd.ActiveConnection = MM_sql2k_STRING
Setting ActiveConnection to a string forces ADO to use an implicit
connection object, which can defeat connection pooling, impairing the
performance and scalability of your application, and perhaps causing your
web server to crash. Always create and open an explicit connection object:
<%
dim cn
Set cn = createobject("adodb.connection")
cn.open MM_sql2k_STRING
Also all that other DW bloat is totally unnecessary, as well as inefficient
and unsafe. The command object was unnecessary, but since you've got it, we
might as well use it to open your recordset easily and safely as this:
dim rs,sql, ,arParms, cmd
sql="select ... where ID = ?"
set cmd=createobject("adodb.connection")
cmd.commandtext=sql
cmd.commandtype=1 'adCmdText
arparms = array(Request.QueryString("prodid"))
set cmd.ActiveConnection = cn
set rs = cmd.execute(,arParms)
if not rs.eof then
PPrice = rs("Retail") 'rs(0) would work also
title = rs("ProductName") 'rs(1) - get the idea?
etc.
end if
'now that you have all the values in variables, close the
'recordset now, as well as closing the connection:
rs.close:set rs = nothing
cn.close: set cn=nothing
Oh wait! I just say something else. Scroll down::
km****@yahoo.com wrote:
<SNIP>
<%
PPrice = (Recordset2.Fields.Item("Retail").Value)
title = (Recordset2.Fields.Item("ProductName").Value)
ID = (Recordset2.Fields.Item("ID").Value)
SDesc = (Recordset2.Fields.Item("ShortDescription").Value)
SPIC = (Recordset2.Fields.Item("Thumbnail").Value)
PayOText = (Recordset2.Fields.Item("PayOptionText").Value)
ShipO=(Recordset2.Fields.Item("ShipOptionText").Va lue)
SShipO = (Recordset2.Fields.Item("SpecialShippingText").Val ue)
STrade = (Recordset2.Fields.Item("Trademark").Value)
%>
<br>
<img src="<%=SPIC%>" alt=""><br>
<%=(Recordset2.Fields.Item("ProductName").Value)%> <br>
You have your values in variables. WHY IS YOUR RECORDSET STILL OPEN?
AND WHY ARE YOU STILL TRYING TO PULL THE VALUES OUT OF THE RECORDSET? Ooops,
hit my caps lock by mistake ...
The reason for setting the values to the variables was so you could use the
variables _instead of the recordset_!
Change all of these to variations of:
<img src="<%=SPIC%>" alt=""><br>
<%= title%><br>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"