Wrox Programmer Forums
|
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
 
Old April 5th, 2004, 03:43 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing and Setting a new Value

Hi
I'm having a lot of trouble setting a value in a database via ASP. MY ASP code was generated by Frontpage 2003, I have edited out all the comments and webbot code to get back to just Pure ASP code. The page was meant to collect the value ImageURL from the page input which works fine. I now want to pass in that value from another calling form....herein lies my problems

I am passing a value into this page in question Using the
 ?parameter=Value Method

But I cannot set the value in the database

I have included a code chunk look for teh bit in large red letters for context.

I have tried the following to no avail

arFormValues0(19) = ::ImageURL::
arFormValues0(19) = '::ImageURL::'
arFormValues0(19) = 'ImageURL'

Oh, this does not work either
arFormValues0(19) = "Hello world"

which I found rather alarming,

can you help?
Tammy

________________________________________
______Here is most of the code______

________________________________________



<%

On Error Resume Next

strErrorUrl = ""


If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
    Err.Clear

    Set fp_conn = Server.CreateObject("ADODB.Connection")
    FP_DumpError strErrorUrl, "Cannot create connection"

    Set fp_rs = Server.CreateObject("ADODB.Recordset")
    FP_DumpError strErrorUrl, "Cannot create record set"

    fp_conn.Open Application("conn1_ConnectionString")
    FP_DumpError strErrorUrl, "Cannot open database"

    fp_rs.Open "TEACHERS", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
    FP_DumpError strErrorUrl, "Cannot open record set"

    fp_rs.AddNew
    FP_DumpError strErrorUrl, "Cannot add new record set to the database"
    Dim arFormFields0(20)
    Dim arFormDBFields0(20)
    Dim arFormValues0(20)

    arFormFields0(17) = "Experience"
    arFormDBFields0(17) = "Experience"
    arFormValues0(17) = Request("Experience")
    arFormFields0(18) = "Education"
    arFormDBFields0(18) = "Education"
    arFormValues0(18) = Request("Education")
arFormFields0(19) = "ImageURL"
    arFormDBFields0(19) = "ImageURL"
    arFormValues0(19) = Request("ImageURL")

    FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


    fp_rs.Update
    FP_DumpError strErrorUrl, "Cannot update the database"

    fp_rs.Close
    fp_conn.Close

    FP_FormConfirmationFromArrays "text/html; charset=windows-1252",_
                        "Form Confirmation",_
                        "Thank you for submitting the following information:",_
                        "ExplorerDetails.asp",_
                        "Return to the form.",_
                        arFormDBFields0,_
                        arFormValues0

End If
End If

%>
<form METHOD="POST" action="--WEBBOT-SELF--" name="FrontPage_Form1">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0">
<%

%>
<table border="0" cellpadding="2" style="border-collapse: collapse" width="82%" id="table1" bgcolor="#DAD6E6">
  <tr>
    <td width="135" rowspan="21" valign="top">
        <img border="0" src="../supportimages/explor2.jpg" width="199" height="427"></td>
    <td valign="top" align="right" colspan="2">
    <p align="justify"><i><b>





 
Old April 6th, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did you try printing the value of ImageURL that comes from the form to see what it contains?

Response.write Request.Form("ImageURL")

-Vijay G
 
Old April 6th, 2004, 02:43 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Vijay
Thanks for replying. I did test the value being passed across, and it is present.

On a simpler level, can someone explain why in FrontPage2003 if I create a submission form (example chunk of code included) I cannot set the values manually. I have removed all the web bot code that normally rewrites any changes you make. So I should be able to change the line

    arFormValues0(0) = Request("CarPool")
into this for example

    arFormValues0(0) = "School Bus on Monday"

and it should work, but it does not.

here is the code chunk

    fp_rs.AddNew
    FP_DumpError strErrorUrl, "Cannot add new record set to the database"
    Dim arFormFields0(19)
    Dim arFormDBFields0(19)
    Dim arFormValues0(19)

    arFormFields0(0) = "CarPool"
    arFormDBFields0(0) = "CarPool"
    arFormValues0(0) = Request("CarPool")










Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up in Appendix B mnielsen BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 February 16th, 2007 12:23 AM
setting autoincrement tbecker82 Access 3 June 20th, 2006 01:17 PM
Setting Worksheet name marcusfromsweden XSLT 0 September 19th, 2005 11:50 AM
Setting the Focus BSkelding ASP.NET 1.0 and 1.1 Professional 1 May 12th, 2005 01:40 PM
setting classpath aadz5 JSP Basics 1 July 28th, 2004 04:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.