Sure, it's a but long but I did comment where the problem is. The data
enters the record fine. Getting it out is the problem. One person who
tested it got al l blanks where the data was supposed to display. I
could use the variables but wanted to actually show the data in the
record. 

Here's the code:

<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="adovbs.inc"-->
<% pageTitle = "Insert Into IHM Registration Table" %>
<% 
 
'Get the form data
p_payment = Request.form("Payment")
p_firstName = Request.form("firstName")
p_lastName = Request.form("lastName")
p_Class = Request("Class")
p_Degrees = Request("Degrees")
p_Email = Request("Email")
p_Specialty = Request("Specialty")
p_Organization = Request("Organization")
p_Address1 = Request("Address1")
p_Address2 = Request("Address2")
p_City = Request("City")
p_State = Request("State")
p_ZipCode = Request("zipCode")
p_areaCode = Request("areaCode")
p_phExchange = Request("phExchange")
p_phNumber = Request("phNumber")
p_How = Request("How")
p_Diet = Request("Diet")
 

 
'create connection object
set objConn = Server.CreateObject("ADODB.Connection")
 
'Open the connection
objConn.Open  "DRIVER={Microsoft Access DRIVER
(*.mdb)};DBQ=e:\PUBLIC\IHM\forms\IHM.mdb"
 
'Create the recordset object using the connection object you have just
created
Dim objRS
 
set objRS = Server.CreateObject("ADODB.Recordset")
'objRS.Open "Survey",objConn,,,adCmdTable
objRS.Open "Registration",objConn,2,adLockOptimistic,adCmdTable
 
'------Validate form
failure = 0 'flag
 
if p_lastName = "" then  'Lastname field is empty
 response.write "Please enter a last name. <br>"
 failure = 1    'set failure flag
end if
 
if p_firstName = "" then 'Firstname empty
 response.write "Please enter a first name. <br>"
 failure = 1
end if
 
if p_Address1 = "" then 
 response.write "Please include your street address. <br>"
 failure = 1
end if
 
if p_City = "" then
 response.write "Please include your city. <br>"
 failure = 1
end if
 
if p_State = "" then
 response.write "Please include your state. <br>"
 failure = 1
end if
 
if p_ZipCode = "" then
 response.write "Please include your zip code. <br>"
 failure = 1
end if
 

if failure = 1 then 'Form isn't filled out properly. Stop processing and
allow user to fix errors.
' response.clear
 response.write "<b><h3>The form could not be processed due to the above
errors. Use your browser's backspace key to return to the form and
correct the fields.</h3></b>" 
 objConn.Close
 set objConn = Nothing 
 response.end 
end if
 

'Enries are okay. Create record
 
objRS.AddNew
 
objRS("lastName") = p_lastName
objRS("firstName") = p_firstName
objRS("Degrees") = p_Degrees
objRS("Email") = p_Email
objRS("Specialty") = p_Specialty
objRS("Organization") = p_Organization
objRS("Address1") = p_Address1
objRS("Address2") = p_Address2
objRS("City") = p_City
objRS("State") = p_State
objRS("ZipCode") = p_ZipCode
objRS("AreaCode") = p_AreaCode
objRS("ph_Exchange") = p_phExchange
objRS("ph_Number") = p_phNumber
objRS("How") = p_How
objRS("Diet") = p_Diet
objRS.Update
objRS.Movelast
 
 
 
'Did anything go wrong with the update.....Error handling
 
response.write "<div align='center'>"
if Err.Number > 0 then
 'There was a problem with the update
 response.write "<H2>Unable to submit survery</h2><P>"
 response.write "There was a problem when processing the form. Go back
and double check your entries."
 response.write "</DIV>"
 'Close the connection
 objConn.Close
 set objConn = Nothing
 response.end
end if
 
'Build the page to allow them to confirm their answers using the data
from record. 
%>
 
<HTML>
<title>IHM Confirmation Screen</title>
<BODY>
<p>This is the information that you entered. Please check for errors and
correct
  any fields that are wrong.</p>
 
<form name="form1" method="post" action="submit_IHM_registra.asp">
 <table border=0 align="center" cellpadding=0 cellspacing=0
class=MsoTableGrid>
   <tr>
   <td width=151 height=32 colspan=2 align="left" valign=middle
class="Normal">
   <p><font size=2 face='Arial, Helvetica, sans-serif'>First
Name</font></p>
    </td>
   <td width=436 colspan=7 valign="middle" class="Normal"><%="<input
name='firstName' type='text' size='20' maxlength='50' value= " &
objRS("firstname") & ">" %>
   </td>
  </tr>
  <tr>
   <td width=151 height="31" colspan=2 align="left" valign=middle
class="Normal">
   <p><font size="2" face="Arial, Helvetica, sans-serif">Last
Name</font></p>
   </td>
   <td width=436 colspan=7 valign=middle class='Normal'>
   <%= "<input name='lastName' type='text' size='20' maxlength='50'
value = " & objRS("lastName") & ">" %> 
        </td>
      </tr>
      <tr>
        <td width=151 colspan=2 align="left" valign=middle
class="Normal">
          <p><font size="2" face="Arial, Helvetica,
sans-serif">Degrees</font></p>
        </td>
        <td width=436 colspan=7 valign=top class="Normal">
  <%= "<textarea name='degrees' cols='20' rows='4' id='degrees'>" &
objRS("Degrees") & "</textarea>" %>
</td>
      </tr>
      <tr>
        <td height="29" colspan=2 align="left" valign=middle
class="Normal"><font size="2" face="Arial, Helvetica, sans-serif">Email
            Address</font></td>
        <td colspan=7 align="left" valign=middle class="Normal">
  <%= "<input name='Email' type='text' id='Email' size='20'
maxlength='30' value= " & objRS("Email") & ">" %>
   </td>
      </tr>
      <tr>
        <td width=151 height="29" colspan=2 align="left" valign=middle
class="Normal">
          <p><font size="2" face="Arial, Helvetica, sans-serif">Medical
Specialty</font></p>
        </td>
        <td width=436 colspan=7 align="left" valign=middle
class="Normal">
  <%= "<input name='specialty' type='text' size='20' maxlength='50'
value = " & objRS("Specialty") & ">" %> 
        </td>
      </tr>
      <tr>
        <td width=151 height="30" colspan=2 align="left" valign=middle
class="Normal">
          <p><font size="2" face="Arial, Helvetica,
sans-serif">Organization</font></p>
        </td>
        <td width=436 colspan=7 align="left" valign=middle
class="Normal">
  <%= "<input name='Organization' type='text' id='Organization'
size='20' maxlength='50' value= " & objRS("Organization") & ">" %> 
        </td>
      </tr>

<%= ' This next row doesn't appear on the screen either. It does show up
in Dreamweaver though.  %>

      <tr>
        <td width=151 height="31" colspan=2 align="left" valign=middle
class="Normal">
          <p><font size="2" face="Arial, Helvetica, sans-serif">Street
Address</font></p>
        </td>
        <td width=436 colspan=7 align="left" valign=middle
class="Normal">
  <%="<input name='Address1' type='text' id='Address1' size='20'
maxlength='50' value = " & objRS("Address1") & ">" %> 
        </td>
      </tr>
<%= ' -------------------------------------------- %>
   
      <tr>
        <td width=151 height="31" colspan=2 align="left" valign=middle
class="Normal">
          <p><font size="2" face="Arial, Helvetica, sans-serif">Address
cont.</font></p>
        </td>
        <td width=436 colspan=7 align="left" valign=middle
class="Normal">
  <%="<input name='Address2' type='text' id='Address2' size='20'
maxlength='50' value = " & objRS("Address2") & ">" %> 
        </td>
      </tr>
      <tr>
        <td width=55 height="30" valign=middle class="Normal">
          <p><span style='font-size:11.0pt;
  font-family:Georgia;'><font size="2" face="Arial, Helvetica,
sans-serif">City</font></span></p>
        </td>
        <td width=204 colspan=3 align="left" valign=middle
class="Normal">
  <%="<input name='city' type='text' id='city' size='20' maxlength='50'
value = " & objRS("City") & ">" %> 
        </td>
        <td width=48 colspan=2 align="left" valign=middle
class="Normal">
          <p align=left style='text-align='left'><font size="2"
face="Arial, Helvetica, sans-serif">State</font></p>
        </td>
        <td width=144 align="left" valign=middle class="Normal"><select
name="State" size="1" id="State">
 
          <%= "<option value='Alabama'" %>
    <% If objRS("State") = "Alabama" Then Response.Write " selected" End
If %>
    <%= ">Alabama</option>" %>    
 

          <%= "<option value='Alaska'" %>
    <% If objRS("State") = "Alaska" Then Response.Write " selected" End
If %>
    <%= ">Alaska</option>" %>
 
          <%= "<option value='Arizona'" %>
    <% If objRS("State") = "Arizona" Then Response.Write " selected" End
If %>
    <%= ">Arizona</option>" %>
    
          <%= "<option value='Arkansas'" %>
    <% If objRS("State") = "Arkansas" Then Response.Write " selected"
End If %>
    <%= ">Arkansas</option>" %>
    
          <%= "<option value='California'" %>
    <% If objRS("State") = "California" Then Response.Write " selected"
End If %>
    <%= ">California</option>" %>
          
    <%= "<option value='Colorado'" %>
    <% If objRS("State") = "Colorado" Then Response.Write " selected"
End If %>
    <%= ">Colorado</option>" %>
          
    <%= "<option value='Connecticut'" %>
    <% If objRS("State") = "Connecticut" Then Response.Write " selected"
End If %>
    <%= ">Connecticut</option>" %>
          
    <%= "<option value='Delaware'" %>
    <% If objRS("State") = "Arizona" Then Response.Write " selected" End
If %>
    <%= ">Arizona</option>" %>
    
    <%= "<option value='District of Columbia'" %>
    <% If objRS("State") = "District of Columbia" Then Response.Write "
selected" End If %>
    <%= ">District of Columbia</option>" %>
    
    <%= "<option value='Florida'" %>
    <% If objRS("State") = "Florida" Then Response.Write " selected" End
If %>
    <%= ">Florida</option>" %>
    
    <%= "<option value='Georgia'" %>
    <% If objRS("State") = "Georgia" Then Response.Write " selected" End
If %>
    <%= ">Georgia</option>" %>
    
    <%= "<option value='Hawaii'" %>
    <% If objRS("State") = "Hawaii" Then Response.Write " selected" End
If %>
    <%= ">Hawaii</option>" %>
    
    <%= "<option value='Idaho'" %>
    <% If objRS("State") = "Idaho" Then Response.Write " selected" End
If %>
    <%= ">Idaho</option>" %>
    
    <%= "<option value='Illinois'" %>
    <% If objRS("State") = "Illinois" Then Response.Write " selected"
End If %>
    <%= ">Illinois</option>" %>
 
    <%= "<option value='Indiana'" %>
    <% If objRS("State") = "Indiana" Then Response.Write " selected" End
If %>
    <%= ">Indiana</option>" %>
 
    <%= "<option value='Iowa'" %>
    <% If objRS("State") = "Iowa" Then Response.Write " selected" End If
%>
    <%= ">Iowa</option>" %>
 
    <%= "<option value='Kansas'" %>
    <% If objRS("State") = "Kansas" Then Response.Write " selected" End
If %>
    <%= ">Kansas</option>" %>
 
    <%= "<option value='Kentucky'" %>
    <% If objRS("State") = "Kentucky" Then Response.Write " selected"
End If %>
    <%= ">Kentucky</option>" %>
 
    <%= "<option value='Louisiana'" %>
    <% If objRS("State") = "Louisiana" Then Response.Write " selected"
End If %>
    <%= ">Louisiana</option>" %>
 
    <%= "<option value='Maine'" %>
    <% If objRS("State") = "Maine" Then Response.Write " selected" End
If %>
    <%= ">Maine</option>" %>
 
    <%= "<option value='Maryland'" %>
    <% If objRS("State") = "Maryland" Then Response.Write " selected"
End If %>
    <%= ">Maryland</option>" %>
 
    <%= "<option value='Massachusetts'" %>
    <% If objRS("State") = "Massachusetts" Then Response.Write "
selected" End If %>
    <%= ">Massachusetts</option>" %>
 
    <%= "<option value='Michigan'" %>
    <% If objRS("State") = "Michigan" Then Response.Write " selected"
End If %>
    <%= ">Michigan</option>" %>
 
    <%= "<option value='Minnesota'" %>
    <% If objRS("State") = "Minnesota" Then Response.Write " selected"
End If %>
    <%= ">Minnesota</option>" %>
 
    <%= "<option value='Mississippi'" %>
    <% If objRS("State") = "Mississippi" Then Response.Write " selected"
End If %>
    <%= ">Mississippi</option>" %>
 
    <%= "<option value='Missouri'" %>
    <% If objRS("State") = "Missouri" Then Response.Write " selected"
End If %>
    <%= ">Missouri</option>" %>
 
    <%= "<option value='Montana'" %>
    <% If objRS("State") = "Montana" Then Response.Write " selected" End
If %>
    <%= ">Montana</option>" %>
 
    <%= "<option value='Nebraska'" %>
    <% If objRS("State") = "Nebraska" Then Response.Write " selected"
End If %>
    <%= ">Nebraska</option>" %>
 
    <%= "<option value='Nevada'" %>
    <% If objRS("State") = "Nevada" Then Response.Write " selected" End
If %>
    <%= ">Nevada</option>" %>
 
    <%= "<option value='New Hampshire'" %>
    <% If objRS("State") = "New Hampshire" Then Response.Write "
selected" End If %>
    <%= ">New Hampshire</option>" %>
 
    <%= "<option value='New Jersey'" %>
    <% If objRS("State") = "New Jersey" Then Response.Write " selected"
End If %>
    <%= ">New Jersey</option>" %>
 
    <%= "<option value='New Mexico'" %>
    <% If objRS("State") = "New Mexico" Then Response.Write " selected"
End If %>
    <%= ">New Mexico</option>" %>
 
    <%= "<option value='New York'" %>
    <% If objRS("State") = "New York" Then Response.Write " selected"
End If %>
    <%= ">New York</option>" %>
 
    <%= "<option value='North Carolina'" %>
    <% If objRS("State") = "North Carolina" Then Response.Write "
selected" End If %>
    <%= ">North Carolina</option>" %>
 
    <%= "<option value='North Dakota'" %>
    <% If objRS("State") = "North Dakota" Then Response.Write "
selected" End If %>
    <%= ">North Dakota</option>" %>
 
    <%= "<option value='New Mexico'" %>
    <% If objRS("State") = "New Mexico" Then Response.Write " selected"
End If %>
    <%= ">New Mexico</option>" %>
 
    <%= "<option value='Ohio'" %>
    <% If objRS("State") = "Ohio" Then Response.Write " selected" End If
%>
    <%= ">Ohio</option>" %>
 
    <%= "<option value='Oklahoma'" %>
    <% If objRS("State") = "Oklahoma" Then Response.Write " selected"
End If %>
    <%= ">Oklahoma</option>" %>
 
    <%= "<option value='Oregon'" %>
    <% If objRS("State") = "Oregon" Then Response.Write " selected" End
If %>
    <%= ">Oregon</option>" %>
 
    <%= "<option value='Pennsylvania'" %>
    <% If objRS("State") = "Pennsylvania" Then Response.Write "
selected" End If %>
    <%= ">Pennsylvania</option>" %>
 
    <%= "<option value='Puerto Rico'" %>
    <% If objRS("State") = "Puerto Rico" Then Response.Write " selected"
End If %>
    <%= ">Puerto Rico</option>" %>
 
    <%= "<option value='Rhode Island'" %>
    <% If objRS("State") = "Rhode Island" Then Response.Write "
selected" End If %>
    <%= ">Rhode Island</option>" %>
 
    <%= "<option value='South Carolina'" %>
    <% If objRS("State") = "South Carolina" Then Response.Write "
selected" End If %>
    <%= ">South Carolina</option>" %>
 
    <%= "<option value='Tennessee'" %>
    <% If objRS("State") = "Tennessee" Then Response.Write " selected"
End If %>
    <%= ">Tennessee</option>" %>
 
    <%= "<option value='Texas'" %>
    <% If objRS("State") = "Texas" Then Response.Write " selected" End
If %>
    <%= ">Texas</option>" %>
 
    <%= "<option value='Utah" %>
    <% If objRS("State") = "Utah" Then Response.Write " selected" End If
%>
    <%= ">Utah</option>" %>
 
    <%= "<option value='Vermont'" %>
    <% If objRS("State") = "Vermont" Then Response.Write " selected" End
If %>
    <%= ">Vermont</option>" %>
 
    <%= "<option value='Virgin Islands'" %>
    <% If objRS("State") = "Virgin Islands" Then Response.Write "
selected" End If %>
    <%= ">Virgin Islands</option>" %>
 
    <%= "<option value='Washington'" %>
    <% If objRS("State") = "Washington" Then Response.Write " selected"
End If %>
    <%= ">Washington</option>" %>
 
    <%= "<option value='Wisconsin'" %>
    <% If objRS("State") = "Wisconsin" Then Response.Write " selected"
End If %>
    <%= ">Wisconsin</option>" %>
 
    <%= "<option value='Wyoming'" %>
    <% If objRS("State") = "Wyoming" Then Response.Write " selected" End
If %>
    <%= ">Wyoming</option>" %>
        </select> 
        </td>
        <td width=36 valign=middle class="Normal">
          <p align=left style='text-align:left'><font size="2"
face="Arial, Helvetica, sans-serif">Zip</font></p>
        </td>
        <td width=100 align="left" valign=middle class="Normal">
  <%= "<input name='zipCode' type='text' id='zipCode' size=5
maxlength='5' value= " & objRS("zipCode") & ">" %>
        </td>
      </tr>
      <tr valign="middle">
        <td width=151 height="35" colspan=2 class="Normal">
          <p><font size="2" face="Arial, Helvetica, sans-serif">Daytime
phone</font></p>
        </td>
        <td width=436 colspan=7 class="Normal">
  <%= "<input name='areaCode' type='text' id='areaCode' size='3'
maxlength='3' value = " & objRS("areaCode") & ">" %>
          -
         <%= "<input name='phExchange' type='text' id='phExchange'
size='3' maxlength='3' value = " & objRS("ph_Exchange") & ">" %>
            - 
          <%= "<input name='phNumber' type='text' id='phNumber' size='4'
maxlength='4' value = " & objRS("ph_Number") & ">" %>
        </td>
      </tr>
      <tr>
        <td width=294 height="117" colspan=5 valign=top class="Normal">
          <p><font size="2" face="Arial, Helvetica, sans-serif">How did
you learn about this </font></span><font size="2" face="Arial,
Helvetica, sans-serif">CME course?</font></p>
        </td>
        <td width=292 colspan=4 align="left" valign=top class="Normal">
  <%= "<textarea name='How' cols='25' rows='5' id='How'>" & objRS("How")
& "</textarea>" %>
        </td>
      </tr>
      <tr>
        <td width=587 height="118" colspan=9 valign=top
class="Normal"><table width="100%"  border="0" cellspacing="0"
cellpadding="0">
          <tr>
            <td width="50%" valign="top"><p><font size="2" face="Arial,
Helvetica, sans-serif">Persons
                  with a disability or a special dietary requirement may
request
                  a reasonable accommodation by contacting
                Susan Hurt at [EMAIL PROTECTED]</font></p>
              <p><font size="2" face="Arial, Helvetica,
sans-serif">Requests
                  should be made as early as possible to allow time
                  to arrange the accommodation.</font><br>
                  <br>
              </p>
            </td>
            <td width="50%" align="center" valign="top">
                <div align="left">
                  <%= "<textarea name='Diet' cols='30' rows='3'
id='Diet'>" & objRS("Diet") & "</textarea>" %>
              </div></td></tr>
        </table> 
        </td>
      </tr>
      <tr>
        <td width=175 height="21" colspan=3 valign=top class="Normal">
          <p>&nbsp;</p>
        </td>
        <td width=412 colspan=6 valign=top class="Normal"><p>&nbsp;</p> 
        </td>
      </tr>
      <tr>
        <td width=587 colspan=9 valign=top class="Normal"><table
width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="42%" align="right" valign="middle"><input
type="submit" name="Submit" value="Submit Form"></td>
            <td width="13%">&nbsp;</td>
            <td width="45%"><input name="Clear" type="reset" id="Clear"
value="Clear Form"></td>
          </tr>
        </table> 
        </td>
      </tr>
      <tr height=0>
        <td width=55 class="Normal"></td>
        <td width=96 class="Normal"></td>
        <td width=24 class="Normal"></td>
        <td width=84 class="Normal"></td>
        <td width=35 class="Normal"></td>
        <td width=13 class="Normal"></td>
        <td width=144 class="Normal"></td>
        <td width=36 class="Normal"></td>
        <td width=100 class="Normal"></td>
      </tr>
    </table>
</form>
 
</BODY>
</HTML>


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
Moshe Tapnack
Sent: Thursday, May 19, 2005 9:39 AM
To: [email protected]
Subject: RE: [asp] ASP Script Problem with text fields in Access

Can you show the code?

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
Randy
Schirmer
Sent: Thursday, May 19, 2005 3:16 PM
To: [email protected]
Subject: [asp] ASP Script Problem with text fields in Access


Hi All,

This is slightly OT because I'm asking about pulling data from an Access
database but I am using an ASP script. This is something I haven't
encountered before so I'm sitting here wondering why this would behave
this way. 

The set up is simple. I have a form and a submission page that does the
validation routines and then enters the data into a new record. That's
fine. But I like to use a confirmation screen where I rebuild the page
using the data taken from the data fields. I could use the variables but
I'm confirming the data that actually is in the record. But text field
data only shows the first word of the field. For example, the data field
Address1 will have "413 West 5th Ave" but objRS("Address1") will only
display "413". The quotes are only here for clarity. They aren't in the
record. Memo fields show everything. I have a drop down list of states
and states like New York show up fine as well. I looked at the record
itself and the data is all there. I've done this before but either I'm
doing something different or this version of Access behaves differently.
It only happens with text fields.

I'm assuming this is a script problem more than an Access problem since
the data is there. 

Thanks so much!

Randy S.


[Non-text portions of this message have been removed]



ASP Resources  www.asp-dev.com

============================================================
Learn over lunch. Get the developerWorks newsletter and
enjoy tools, code, and tutorials, along with your sandwich.
XML, Linux, Web services, Java -- and peanut butter!
http://www.topica.com/partner/AP-1RMZ49/partners/ibm/aff_landing.html
============================================================






  _____  

Yahoo! Groups Links


*       To visit your group on the web, go to:
http://groups.yahoo.com/group/asp/
  

*       To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
  

*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
<http://docs.yahoo.com/info/terms/> . 




[Non-text portions of this message have been removed]



ASP Resources  www.asp-dev.com

============================================================
Learn over lunch. Get the developerWorks newsletter and
enjoy tools, code, and tutorials, along with your sandwich.
XML, Linux, Web services, Java -- and peanut butter!
http://www.topica.com/partner/AP-1RMZ49/partners/ibm/aff_landing.html
============================================================
 

 
Yahoo! Groups Links



 




ASP Resources  www.asp-dev.com

============================================================
Learn over lunch. Get the developerWorks newsletter and
enjoy tools, code, and tutorials, along with your sandwich.
XML, Linux, Web services, Java -- and peanut butter!
http://www.topica.com/partner/AP-1RMZ49/partners/ibm/aff_landing.html
============================================================
 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/asp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to