Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Re: Adding Records Loop


Message #1 by "Mendez, Jeff" <JMendez@k...> on Fri, 1 Mar 2002 08:24:08 -1000
Raymond,



I looked at your suggestions and tried a few things, but the two lines don't

seem to work in tandem.



Thank you for the help you have given to me.  It has been very helpful.



Attached is my new code.  I have added code in the body tag and there is a

meta http-equiv towards the bottom that has been added.



Mahalo,



Jeff









<% Option Explicit %>

<!-- #include virtual="common/adovbs.inc" -->

<html>

<head>

<title>Enter New Project Information</title>

</head>

<body bgcolor="#ffffff" vlink=black

onload="javascript:document.ProjAdd.ProjNbr.focus();">

<!-- #include file="header.inc" --><p>



<% 

If Request("ProjNbr")="" Or Request("Description")="" Or _

   Request("ProjectName")="" Or Request("WaterSystem")="" Or _

   Request("Location")="" Or Request("Proj_Mgr")="" Then 

%>

<% ShowHeader "Enter New Project" %>

Please fill in all of these fields below. <p>

When you are finished, click the Submit Record button.<p>





<form method="post" action="placead.asp" name="ProjAdd" >

<table>

<tr><td>Project Number:</td>

<td><input size="50" name="ProjNbr" ></td></tr>



<TR><td valign=top>Project Name:</td>

<td><input size=50 name="ProjectName" ></td></TR>



<TR><td valign=top>Description:</td>

<td><TEXTAREA cols=50 name="Description" rows=6></TEXTAREA></td></TR>



<tr><td>Water System:</td>

<td> <select name="WaterSystem" size="1">

  <option selected value="Lihue">Lihue-Hanamaulu</option>

  <option value="Kapaa">Wailua-Kapaa</option>

  <option value="Koloa">Koloa-Poipu</option>

  <option value="Waimea">Waimea-Kekaha</option>

  <option value="Haena">Haena-Wainiha</option>

</select></td></tr>



<tr><td>Location:</td>

<td><input size="10" name="Location" ></td></tr>



<tr><td>Project Type:</td>

<td><input size="15" name="Proj_Type" ></td></tr>



<tr><td>Project Manager:</td>

<td><input size="50" name="Proj_Mgr" ></td></tr>



<tr><td>Percent Complete:</td>

<td><input size="3" name="Pct_Complete" ></td></tr>



<tr><td>Estimated Cost:</td>

<td><input size="50" name="Est_Cost"></td></tr>



<tr><td><input type="submit" value="Submit Record"></td></tr>

</table>

</form>



<% Else %>

<%

Dim Query, Connect, Classifieds, Place



ShowHeader "Enter New Project"



On Error Resume Next



Set Connect = Server.CreateObject("ADODB.Connection")

Connect.Open "ProjectInfo"



Set Classifieds = Server.CreateObject("ADODB.Recordset")

Classifieds.Open

"Proj_Info",Connect,adOpenDynamic,adLockOptimistic,adCmdTable



Classifieds.AddNew

Classifieds("Project_Nbr") = Request("ProjNbr")

Classifieds("Project_Name") = Request("ProjectName")

Classifieds("Description") = Request("Description")

Classifieds("WaterSystem") = Request("WaterSystem")

Classifieds("Location") = Request("Location")

Classifieds("Proj_Type") = Request("Proj_Type")

Classifieds("Proj_Mgr") = Request("Proj_Mgr")

Classifieds("Pct_Complete") = Request("Pct_Complete")

Classifieds("Est_Cost") = Request("Est_Cost")

Classifieds.Update

'Classifieds.Close



If Err.Number = 0 Then %>

<font size=5><i>Your Record has been Added.</i></font><p>

<meta http-equiv="Refresh" content="1; url=http://dow_sms/placead.asp">

<% Else %>

There was an error placing your ad.<p>

Error #<%=Err.Number%>  : <%=Err.Description%><p>

<% End If %>

<% End If %></p>





</body>

</html>









-----Original Message-----

From: Raymond Dalton [mailto:rdalton@c...]

Sent: Monday, February 25, 2002 3:06 PM

To: Access ASP

Subject: [access_asp] Re: Adding Records Loop





Jeff,



We might need to account for the appropriate DOM depending upon what 

browser you are using.  I tested using N4.78 and IE 6, which will usually 

cover any basic issues.



The big thing to check is your capitalization.  Javascript is case 

sensitive.  Make sure that all your references use the same case.  If you 

reference 



onload="javascript:document.Addform.ProjNbr.focus();" 



and the form is actually called addform or the field is actually called 

projnbr then you will get the object not found error, because addform is a 

different name than Addform.



Check this first.  If that isn't the problem then send me your new updated 

page code, and I will look to see what the problem is.



Thanks,



Raymond




Message #2 by "Zee Computer Consulting" <zee@t...> on Fri, 1 Mar 2002 12:47:37 -0800
The <meta> is used within the <head> and </head> tags.



-- Zee









----- Original Message -----

From: "Mendez, Jeff" <JMendez@k...>

To: "Access ASP" <access_asp@p...>

Sent: Friday, March 01, 2002 10:24 AM

Subject: [access_asp] Re: Adding Records Loop





> Raymond,

>

> I looked at your suggestions and tried a few things, but the two lines

don't

> seem to work in tandem.

>

> Thank you for the help you have given to me.  It has been very helpful.

>

> Attached is my new code.  I have added code in the body tag and there is a

> meta http-equiv towards the bottom that has been added.

>

> Mahalo,

>

> Jeff

>

>

>

>

> <% Option Explicit %>

> <!-- #include virtual="common/adovbs.inc" -->

> <html>

> <head>

> <title>Enter New Project Information</title>

> </head>

> <body bgcolor="#ffffff" vlink=black

> onload="javascript:document.ProjAdd.ProjNbr.focus();">

> <!-- #include file="header.inc" --><p>

>

> <%

> If Request("ProjNbr")="" Or Request("Description")="" Or _

>    Request("ProjectName")="" Or Request("WaterSystem")="" Or _

>    Request("Location")="" Or Request("Proj_Mgr")="" Then

> %>

> <% ShowHeader "Enter New Project" %>

> Please fill in all of these fields below. <p>

> When you are finished, click the Submit Record button.<p>

>

>

> <form method="post" action="placead.asp" name="ProjAdd" >

> <table>

> <tr><td>Project Number:</td>

> <td><input size="50" name="ProjNbr" ></td></tr>

>

> <TR><td valign=top>Project Name:</td>

> <td><input size=50 name="ProjectName" ></td></TR>

>

> <TR><td valign=top>Description:</td>

> <td><TEXTAREA cols=50 name="Description" rows=6></TEXTAREA></td></TR>

>

> <tr><td>Water System:</td>

> <td> <select name="WaterSystem" size="1">

>   <option selected value="Lihue">Lihue-Hanamaulu</option>

>   <option value="Kapaa">Wailua-Kapaa</option>

>   <option value="Koloa">Koloa-Poipu</option>

>   <option value="Waimea">Waimea-Kekaha</option>

>   <option value="Haena">Haena-Wainiha</option>

> </select></td></tr>

>

> <tr><td>Location:</td>

> <td><input size="10" name="Location" ></td></tr>

>

> <tr><td>Project Type:</td>

> <td><input size="15" name="Proj_Type" ></td></tr>

>

> <tr><td>Project Manager:</td>

> <td><input size="50" name="Proj_Mgr" ></td></tr>

>

> <tr><td>Percent Complete:</td>

> <td><input size="3" name="Pct_Complete" ></td></tr>

>

> <tr><td>Estimated Cost:</td>

> <td><input size="50" name="Est_Cost"></td></tr>

>

> <tr><td><input type="submit" value="Submit Record"></td></tr>

> </table>

> </form>

>

> <% Else %>

> <%

> Dim Query, Connect, Classifieds, Place

>

> ShowHeader "Enter New Project"

>

> On Error Resume Next

>

> Set Connect = Server.CreateObject("ADODB.Connection")

> Connect.Open "ProjectInfo"

>

> Set Classifieds = Server.CreateObject("ADODB.Recordset")

> Classifieds.Open

> "Proj_Info",Connect,adOpenDynamic,adLockOptimistic,adCmdTable

>

> Classifieds.AddNew

> Classifieds("Project_Nbr") = Request("ProjNbr")

> Classifieds("Project_Name") = Request("ProjectName")

> Classifieds("Description") = Request("Description")

> Classifieds("WaterSystem") = Request("WaterSystem")

> Classifieds("Location") = Request("Location")

> Classifieds("Proj_Type") = Request("Proj_Type")

> Classifieds("Proj_Mgr") = Request("Proj_Mgr")

> Classifieds("Pct_Complete") = Request("Pct_Complete")

> Classifieds("Est_Cost") = Request("Est_Cost")

> Classifieds.Update

> 'Classifieds.Close

>

> If Err.Number = 0 Then %>

> <font size=5><i>Your Record has been Added.</i></font><p>

> <meta http-equiv="Refresh" content="1; url=http://dow_sms/placead.asp">

> <% Else %>

> There was an error placing your ad.<p>

> Error #<%=Err.Number%>  : <%=Err.Description%><p>

> <% End If %>

> <% End If %></p>

>

>

> </body>

> </html>

>

>

>

>

> -----Original Message-----

> From: Raymond Dalton [mailto:rdalton@c...]

> Sent: Monday, February 25, 2002 3:06 PM

> To: Access ASP

> Subject: [access_asp] Re: Adding Records Loop

>

>

> Jeff,

>

> We might need to account for the appropriate DOM depending upon what

> browser you are using.  I tested using N4.78 and IE 6, which will usually

> cover any basic issues.

>

> The big thing to check is your capitalization.  Javascript is case

> sensitive.  Make sure that all your references use the same case.  If you

> reference

>

> onload="javascript:document.Addform.ProjNbr.focus();"

>

> and the form is actually called addform or the field is actually called

> projnbr then you will get the object not found error, because addform is a

> different name than Addform.

>

> Check this first.  If that isn't the problem then send me your new updated

> page code, and I will look to see what the problem is.

>

> Thanks,

>

> Raymond




$subst('Email.Unsub').

>




$subst('Email.Unsub').

>




  Return to Index