 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 8th, 2004, 11:34 PM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Microsoft JET Database Engine (0x80040E10)
my code as under
------------------
it edit ring routine
<%if session("granted") = false then
response.redirect("unauth.htm")
else
end if
dim objRS
set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open ("Select * from tblRings "), conn,1,3
%>
<html>
<head>
<title>Epza Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<Script language="JavaScript">
function checkData(){
if (document.frm.item_id.value == "" ||document.frm.item_id.value=="0") {
alert("Please Select the Ring Name")
document.frm.item_id.focus()
return false}
}
</Script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="784" border="0">
<tr>
<td><b>Edit
Ring</b></td>
</tr>
</table>
<form action="./info_ring.asp" method="post" name="frm" id="frm" onSubmit="return checkData()">
<table width="44%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="35%"><strong>Ring
Name </strong></td>
<td width="65%"> <strong>
<strong>
<select name="item_id">
<option value="0" selected>Select Ring Name</option>
<%
while objRS.eof <> true
%>
<option value="<%=objRS("item-id")%>"><%=objRS("name")%></option>
<%
objRS.movenext()
wend
%>
</select></strong>
</strong></td>
</tr>
<tr>
<td><input type="submit" value="Select" name="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
<%
objRS.close
conn.close
%>
----------------------------------
it is info_ring routine
<%if session("granted") = false then
response.redirect("unauth.htm")
else
end if
itemid=request("item_id")
set objRS = Server.CreateoBject("Adodb.Recordset")
objRS.open ("select * from tblRings where item-id = " &cint(itemid) ), conn,1,3
%>
<html>
<head>
<title>Epza Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<Script language="JavaScript">
function checkData(){
if (document.addprd.memid.value == "" ||document.addprd.memid.value=="0") {
alert("Please Select the Messers Name")
document.addprd.memid.focus()
return false}
if (document.addprd.product_name.value == "" ||document.addprd.product_name.value=="0") {
alert("Please Select the Product Name")
document.addprd.product_name.focus()
return false}
}
</Script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="784" border="0">
<tr>
<td><b>Edit
Product</b></td>
</tr>
</table>
<form action="updateproduct.asp" method="post" name="addprd" id="addprd" onsubmit="return checkData()">
<table width="478" border="0">
<tr>
<td width="82"><b>Ring
Name </b> </td>
<td width="386"><input name="ring_name" type="text" value="<% = objRS("name")%>"></td>
</tr>
<tr>
<td><b> Description</b></td>
<td><textarea name="desc" id="textarea"><%=objRS("desc")%></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input name="Submit" type="submit" class="gy" style="BACKGROUND-COLOR: #98BADC; BORDER-BOTTOM-COLOR: #69f; BORDER-BOTTOM-STYLE: outset; BORDER-LEFT-COLOR: #69a; BORDER-LEFT-STYLE: outset; BORDER-RIGHT-COLOR: #69f; BORDER-RIGHT-STYLE: outset; BORDER-TOP-COLOR: #69f; BORDER-TOP-STYLE: outset; COLOR: #fff; FONT-WEIGHT: bold" onClick="MM_validateForm('messer_name','','R','ema il_address','','NisEmail','Representative_name','' ,'R','location','','R');return document.MM_returnValue" value="Update"></td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
<%
objRS.close
conn.close
set obj.RS = nothing
set conn = nothing
%>
--------------------------
the data is properly post but error shown
whats wrong pls help me
|
|

June 9th, 2004, 12:12 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Can you post your connection string here?
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|
|

June 9th, 2004, 12:14 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
Hi,
Can u paste the line number where this error is coming up, and the line in your code?
Om Prakash
|
|

June 9th, 2004, 12:18 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the error occurs at this line of info_ring.asp
objRS.open ("select * from tblRings where item-id = " &cint(itemid) ), conn,1,3
and my connection string is
connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = "& server.MapPath("./_db/online_db.mdb")
|
|

June 9th, 2004, 12:33 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Knight,
There seems no problem with your connection string.
Then do a response.write next to that line and copy paste that output and execute the same in your Access db directly to see if that returns proper result.
strsql="select * from tblRings where item-id = " & itemid
response.write strsql
response.end
objRS.open (strsql), conn,1,3
PS: You dont have to do a CINT() conversion there.
You should avoid using hypen in your columnnames (item-id). You may read out the documentation on naming conventions in SQL server.
Hope that helps.
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|
|

June 9th, 2004, 12:44 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i add as under
itemid=request("item_id")
set objRS = Server.CreateoBject("Adodb.Recordset")
strsql = "select * from tblRings where item-id = " &itemid
-----------> this is line no 10 objRS.open strsql,conn
response.write strsql
response.end
%>
error shown
-------
Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/jewler/admin/info_ring.asp, line 10
|
|

June 9th, 2004, 12:48 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Please see my previous post again and add that in order given there.
I have used "response.end" before "objRS.open" just to stope the page processing at that point and not let it execute "objRS.open" and give the same error.
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|
|

June 9th, 2004, 12:50 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I am sure, your ITEMID variable doesn't hold any value as per your previous post. Check if that comes with value. This is the solution to your post.;)
I missed that in my previous post.
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|
|

June 9th, 2004, 12:50 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yea now its fine when i change my db field to item_id and use ur
method its going fine now thanks a lot happyqy
|
|

June 9th, 2004, 12:53 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
but dear can u tell me one thing more i have saved different size of
ring such as 5.5, 6,6.5 when i will add ring via add routine we use
checkboxes how can i edit those in edit routine my edit routine u have seen
any idia pls tell me
|
|
 |