|
 |
asp_databases thread: retrieving the records
Message #1 by arshad siddiqui <ash_arshad@y...> on Thu, 28 Mar 2002 03:05:51 -0800 (PST)
|
|
Hi,
I am trying to retrieve the records from my database
into text boxes.
some of the records are retrieved but the records that
I want to display in textarea boxes are not there the
datatypes for these records in database are
"memo".Plus the record from the database which i wanna
display in <input type="file> is also not displayed.
I dont know what is the problem as no error is coming.
Help needed
Thanks
Regards
--Arshad--
here goes the code:
<%@ Language=VBScript%>
<!-- #INCLUDE VIRTUAL FILE="adovbs.inc" -->
<%
if session("user")="" then
Response.Redirect "admin.asp"
end if
%>
<%
set cn=server.createobject("ADODB.Connection")
cn.Open "DBQ=" & Server.Mappath("Ramy.mdb") &
";Driver={Microsoft Access Driver (*.mdb)};"
productid=request("productid")
sql1="select
AccessoryID,CategoryID,SubCatID,AccessoryName,AccessoryDescription,AccessoryPictureFile,AccessorySalePrice,AccessoryDetailDescriptio
n,buys
from products where AccessoryID='"& productid &"'"
set objrs = cn.Execute (sql1)
accid=objrs("AccessoryID")
catid=objrs("CategoryID")
subcatid=objrs("SubCatID")
accname=objrs("AccessoryName")
accdesc=objrs("AccessoryDescription")
accpic=objrs("AccessoryPictureFile")
accsale=objrs("AccessorySalePrice")
accdetail=objrs("AccessoryDetailDescription")
buys=objrs("buys")
%>
<HTML><HEAD>
<title>Upload Products</title>
<SCRIPT LANGUAGE=javascript>
<!--
function validate()
{
if (document.frmTest.id.value=="")
{
alert("Please enter the Product ID")
document.frmTest.id.focus();
return false;
}
if (document.frmTest.name.value=="")
{
alert("Please enter the Product Name")
document.frmTest.desc.focus();
return false;
}
if (document.frmTest.desc.value=="")
{
alert("Please enter the Product Description in Brief")
document.frmTest.desc.focus();
return false;
}
if (document.frmTest.detaildesc.value=="")
{
alert("Please enter the Product Description in
detail")
document.frmTest.detaildesc.focus();
return false;
}
}
//-->
</script>
</head>
<BODY bgColor=white>
<P align=center><FONT style="FONT-FAMILY: verdana"
color="#880000"
size=5><STRONG>Admin Page
for Product Update </STRONG> </FONT></P>
<font color="black" ><STRONG><FONT size=2><FONT
color=black><br> &nb
sp;  
; &
amp;nbsp; &am
p;nbsp; &
nbsp; &nb
sp;  
; &
amp;nbsp; &am
p;nbsp; &
nbsp; &nb
sp;  
; &
amp;nbsp; &am
p;nbsp; &
nbsp;
<FONT face=Verdana size=1>:: Update
Product</FONT> <BR> &a
mp;nbsp; &
;nbsp; &n
bsp; &nbs
p;
&a
mp;nbsp; &
;nbsp; &n
bsp; &nbs
p;
&a
mp;nbsp; &
;nbsp; &n
bsp; &nbs
p;
<FONT color=black><FONT
size=2>
<FONT face=Verdana size=1>::</FONT>
</FONT><FONT face=Verdana size=1>
</FONT>
</FONT></FONT></STRONG>
<A href="admin.asp?task=logout">
<font color="black" size=1
face=Verdana><STRONG>Logout</STRONG></font></A></font></B>
<P></P>
<p
align="left"> &n
bsp; &nbs
p;
</p>
<form METHOD="post" enctype="multipart/form-data"
ACTION="update.asp" name="frmTest" onsubmit="return
validate()">
</FONT>
<div align="center" style="WIDTH: 904px; HEIGHT:
400px">
<center>
<table border="0" cellpadding="0" cellspacing="0"
style="BORDER-COLLAPSE: collapse"
bordercolor="#111111" width="84%" id="AutoNumber1">
<tr>
<td width="35%"><b><font face="Verdana"
size="2">ProductType:</font></b></td>
<td width="65%"><select name=producttype>
<option value=general>General</option>
<option value=hotbuys>HotBuys</option>
</select>
</td>
</tr>
<tr>
<td width="35%"><b><font face="Verdana"
size="2">ProductID:</font></b></td>
<td width="65%"><input name="id"
value="<%=accid%>" size="20"
></td>
</tr>
<tr>
<td width="35%"><b><font size="2"
face="Verdana">Product Name:</font></b></td>
<td width="65%"><input name=name
value="<%=accname%>" size="20"
></td>
</tr>
<tr>
<td width="35%"><b><font face="Verdana"
size="2">Product Description(brief):</font></b></td>
<td width="65%"><TEXTAREA name=desc
value="<%=objrs("AccessoryDescription")%>" rows=3
cols=60></TEXTAREA></td>
</tr>
<tr>
<td width="35%"><b><font face="Verdana"
size="2">Product Image:</font></b></td>
<td width="65%"><input type="file" name="attach"
value="<%=accpic%>" size="40"></td>
</tr>
<tr>
<td width="35%"><b><font face="Verdana"
size="2">Product Sale Price:</font></b></td>
<td width="65%"><input name="price"
value="<%=accsale%>" size="20"
></td>
</tr>
<tr>
<td width="35%"><b><font face="Verdana"
size="2">Product
Description(Detail):</font></b></td>
<td width="65%"><TEXTAREA name=detaildesc
value="<%=accdetail%>" rows=5 cols=60></TEXTAREA></td>
</tr>
</table>
<p>
<input type="submit" value=Upload name="B1" >
</form></P></CENTER></DIV>
</BODY></HTML>
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Thu, 28 Mar 2002 09:26:32 -0500
|
|
The contents of a textarea are not the same thing as the value. Write
it like this instead:
<TEXTAREA name="desc" rows="3" cols="60">
<%=objrs("AccessoryDescription")%>
</TEXTAREA>
Regards,
Pete
> -----Original Message-----
> From: arshad siddiqui [mailto:ash_arshad@y...]
> Sent: Thursday, March 28, 2002 6:06 AM
> To: ASP Databases
> Subject: [asp_databases] retrieving the records
>
>
> Hi,
> I am trying to retrieve the records from my database
> into text boxes.
> some of the records are retrieved but the records that
> I want to display in textarea boxes are not there the
> datatypes for these records in database are
> "memo".Plus the record from the database which i wanna
> display in <input type="file> is also not displayed.
> I dont know what is the problem as no error is coming.
> Help needed
> Thanks
> Regards
> --Arshad--
>
> here goes the code:
>
> <%@ Language=VBScript%>
> <!-- #INCLUDE VIRTUAL FILE="adovbs.inc" -->
> <%
> if session("user")="" then
> Response.Redirect "admin.asp"
> end if
>
> %>
> <%
> set cn=server.createobject("ADODB.Connection")
> cn.Open "DBQ=" & Server.Mappath("Ramy.mdb") &
> ";Driver={Microsoft Access Driver (*.mdb)};"
> productid=request("productid")
> sql1="select
> AccessoryID,CategoryID,SubCatID,AccessoryName,AccessoryDescrip
> tion,AccessoryPictureFile,AccessorySalePrice,AccessoryDetailDe
> scription,buys
> from products where AccessoryID='"& productid &"'"
> set objrs = cn.Execute (sql1)
> accid=objrs("AccessoryID")
> catid=objrs("CategoryID")
> subcatid=objrs("SubCatID")
> accname=objrs("AccessoryName")
> accdesc=objrs("AccessoryDescription")
> accpic=objrs("AccessoryPictureFile")
> accsale=objrs("AccessorySalePrice")
> accdetail=objrs("AccessoryDetailDescription")
> buys=objrs("buys")
> %>
> <HTML><HEAD>
> <title>Upload Products</title>
>
>
> <SCRIPT LANGUAGE=javascript>
> <!--
>
> function validate()
> {
> if (document.frmTest.id.value=="")
> {
> alert("Please enter the Product ID")
> document.frmTest.id.focus();
> return false;
> }
> if (document.frmTest.name.value=="")
> {
> alert("Please enter the Product Name")
> document.frmTest.desc.focus();
> return false;
> }
> if (document.frmTest.desc.value=="")
> {
> alert("Please enter the Product Description in Brief")
> document.frmTest.desc.focus();
> return false;
> }
> if (document.frmTest.detaildesc.value=="")
> {
> alert("Please enter the Product Description in
> detail")
> document.frmTest.detaildesc.focus();
> return false;
> }
>
> }
> //-->
> </script>
> </head>
> <BODY bgColor=white>
> <P align=center><FONT style="FONT-FAMILY: verdana"
> color="#880000"
> size=5><STRONG>Admin Page
> for Product Update </STRONG> </FONT></P>
> <font color="black" ><STRONG><FONT size=2><FONT
> color=black><br> &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
>
> <FONT face=Verdana size=1>:: Update
> Product</FONT> <BR> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp; &nbs
> p;
> &n
> bsp;
>
> <FONT color=black><FONT
> size=2>
>
> <FONT face=Verdana size=1>::</FONT>
> </FONT><FONT face=Verdana size=1>
> </FONT>
> </FONT></FONT></STRONG>
> <A href="admin.asp?task=logout">
> <font color="black" size=1
> face=Verdana><STRONG>Logout</STRONG></font></A></font></B>
> <P></P>
> <p
> align="left"> &
> nbsp; &nb
> sp;  
> ;
> </p>
> <form METHOD="post" enctype="multipart/form-data"
> ACTION="update.asp" name="frmTest" onsubmit="return
> validate()">
> </FONT>
> <div align="center" style="WIDTH: 904px; HEIGHT:
> 400px">
> <center>
>
> <table border="0" cellpadding="0" cellspacing="0"
> style="BORDER-COLLAPSE: collapse"
> bordercolor="#111111" width="84%" id="AutoNumber1">
>
> <tr>
> <td width="35%"><b><font face="Verdana"
> size="2">ProductType:</font></b></td>
> <td width="65%"><select name=producttype>
> <option value=general>General</option>
> <option value=hotbuys>HotBuys</option>
> </select>
> </td>
> </tr>
>
>
> <tr>
> <td width="35%"><b><font face="Verdana"
> size="2">ProductID:</font></b></td>
> <td width="65%"><input name="id"
> value="<%=accid%>" size="20"
> ></td>
> </tr>
> <tr>
> <td width="35%"><b><font size="2"
> face="Verdana">Product Name:</font></b></td>
> <td width="65%"><input name=name
> value="<%=accname%>" size="20"
> ></td>
> </tr>
> <tr>
> <td width="35%"><b><font face="Verdana"
> size="2">Product Description(brief):</font></b></td>
> <td width="65%"><TEXTAREA name=desc
> value="<%=objrs("AccessoryDescription")%>" rows=3
> cols=60></TEXTAREA></td>
> </tr>
> <tr>
> <td width="35%"><b><font face="Verdana"
> size="2">Product Image:</font></b></td>
> <td width="65%"><input type="file" name="attach"
> value="<%=accpic%>" size="40"></td>
> </tr>
> <tr>
> <td width="35%"><b><font face="Verdana"
> size="2">Product Sale Price:</font></b></td>
> <td width="65%"><input name="price"
> value="<%=accsale%>" size="20"
> ></td>
> </tr>
>
> <tr>
> <td width="35%"><b><font face="Verdana"
> size="2">Product
> Description(Detail):</font></b></td>
> <td width="65%"><TEXTAREA name=detaildesc
> value="<%=accdetail%>" rows=5 cols=60></TEXTAREA></td>
> </tr>
> </table>
> <p>
> <input type="submit" value=Upload name="B1" >
> </form></P></CENTER></DIV>
>
> </BODY></HTML>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards®
> http://movies.yahoo.com/
>
>
Message #3 by arshad siddiqui <ash_arshad@y...> on Thu, 28 Mar 2002 07:15:09 -0800 (PST)
|
|
Hi Peter,
thanks for your invaluable help!!
the script is now working.
Regards
--Arshad--
--- "Peter Foti (PeterF)"
<PeterF@S...> wrote:
> The contents of a textarea are not the same thing as
> the value. Write
> it like this instead:
>
> <TEXTAREA name="desc" rows="3" cols="60">
> <%=objrs("AccessoryDescription")%>
> </TEXTAREA>
>
> Regards,
> Pete
>
> > -----Original Message-----
> > From: arshad siddiqui
> [mailto:ash_arshad@y...]
> > Sent: Thursday, March 28, 2002 6:06 AM
> > To: ASP Databases
> > Subject: [asp_databases] retrieving the records
> >
> >
> > Hi,
> > I am trying to retrieve the records from my
> database
> > into text boxes.
> > some of the records are retrieved but the records
> that
> > I want to display in textarea boxes are not there
> the
> > datatypes for these records in database are
> > "memo".Plus the record from the database which i
> wanna
> > display in <input type="file> is also not
> displayed.
> > I dont know what is the problem as no error is
> coming.
> > Help needed
> > Thanks
> > Regards
> > --Arshad--
> >
> > here goes the code:
> >
> > <%@ Language=VBScript%>
> > <!-- #INCLUDE VIRTUAL FILE="adovbs.inc" -->
> > <%
> > if session("user")="" then
> > Response.Redirect "admin.asp"
> > end if
> >
> > %>
> > <%
> > set cn=server.createobject("ADODB.Connection")
> > cn.Open "DBQ=" & Server.Mappath("Ramy.mdb") &
> > ";Driver={Microsoft Access Driver (*.mdb)};"
> > productid=request("productid")
> > sql1="select
> >
>
AccessoryID,CategoryID,SubCatID,AccessoryName,AccessoryDescrip
> >
>
tion,AccessoryPictureFile,AccessorySalePrice,AccessoryDetailDe
> > scription,buys
> > from products where AccessoryID='"& productid &"'"
> > set objrs = cn.Execute (sql1)
> > accid=objrs("AccessoryID")
> > catid=objrs("CategoryID")
> > subcatid=objrs("SubCatID")
> > accname=objrs("AccessoryName")
> > accdesc=objrs("AccessoryDescription")
> > accpic=objrs("AccessoryPictureFile")
> > accsale=objrs("AccessorySalePrice")
> > accdetail=objrs("AccessoryDetailDescription")
> > buys=objrs("buys")
> > %>
> > <HTML><HEAD>
> > <title>Upload Products</title>
> >
> >
> > <SCRIPT LANGUAGE=javascript>
> > <!--
> >
> > function validate()
> > {
> > if (document.frmTest.id.value=="")
> > {
> > alert("Please enter the Product ID")
> > document.frmTest.id.focus();
> > return false;
> > }
> > if (document.frmTest.name.value=="")
> > {
> > alert("Please enter the Product Name")
> > document.frmTest.desc.focus();
> > return false;
> > }
> > if (document.frmTest.desc.value=="")
> > {
> > alert("Please enter the Product Description in
> Brief")
> > document.frmTest.desc.focus();
> > return false;
> > }
> > if (document.frmTest.detaildesc.value=="")
> > {
> > alert("Please enter the Product Description in
> > detail")
> > document.frmTest.detaildesc.focus();
> > return false;
> > }
> >
> > }
> > //-->
> > </script>
> > </head>
> > <BODY bgColor=white>
> > <P align=center><FONT style="FONT-FAMILY: verdana"
> > color="#880000"
> > size=5><STRONG>Admin Page
> > for Product Update </STRONG> </FONT></P>
> > <font color="black" ><STRONG><FONT size=2><FONT
> >
>
color=black><br> &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> > p;
> >
> > <FONT face=Verdana size=1>:: Update
> >
>
Product</FONT> <BR> &n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> >
>
bsp; &nbs
> >
>
p;
> >
>
&n
> > bsp;
> >
> > <FONT color=black><FONT
> > size=2>
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
|
|
 |