Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Database Insert

    Is there anybody out there who has worked through the Jeffrey Bardzell book
    "Dreamweaver MX 2004 with asp, Coldfusion and php"?
    By various means I have reached the end of the book but the only thing that
    refuses to work is Lesson 16 "Inserting a new Country Profile". I have repeated
    this exercise many times now - even inserting code from the book's CD but it
    just won't work.
    After completing the form I press Submit and am told that the page requested
    cannot be displayed.
    If there is anybody who could cast an eye over the code or who knows about an
    inherent problem I should be more than grateful.
    CODE:
    <%@LANGUAGE="VBSCRIPT"%>
    <%
    ' *** Restrict Access To Page: Grant or deny access to this page
    MM_authorizedUsers="admin"
    MM_authFailedURL="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/login.asp"
    MM_grantAccess=false
    If Session("MM_Username") <> "" Then
    If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
    (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
    MM_grantAccess = true
    End If
    End If
    If Not MM_grantAccess Then
    MM_qsChar = "?"
    If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    MM_referrer = Request.ServerVariables("URL")
    if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
    Request.QueryString()
    MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    Server.URLEncode(MM_referrer)
    Response.Redirect(MM_authFailedURL)
    End If
    %>

    <%
    'Create connection object
    Dim dbConn
    Dim rs_regions
    set dbConn = server.CreateObject("adodb.connection")
    'Connect to database via DSN
    dbConn.open("newland")
    Set rs_regions = dbConn.Execute("SELECT * FROM tbl_region ORDER BY regionName")
    %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Newland Tours: Admin Insert a Country Profile</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/css/newland.css"
    rel="stylesheet" type="text/css" />
    </head>

    <body>
    <a href="#top"><img
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/spacer.gif"
    alt="Skip to main page content." width="1" height="1" border="0" align="left"
    /></a>
    <table width="750" border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td width="470"><img
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_left.gif"
    width="451" height="68" alt="Newland Tours Banner, Left" /></td>
    <td width="280"><img
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_right.jpg"
    width="276" height="68" alt="Newland Tours Banner, Right" /></td>
    </tr>
    <tr>
    <td><img
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/navbar.gif"
    name="navbar" width="450" height="20" border="0" usemap="#navbarMap"
    alt="Navigation Bar" /></td>
    <td><img name="copyright_bar"
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/copyright_bar.gif"
    width="272" height="20" border="0" alt="Copyright 2004 Newland Tours" /></td>
    </tr>
    <tr>
    <td colspan="2">
    <h1><br />
    <a name="top" id="top"></a>Insert a New Country Profile </h1>
    <form name="frm_insertProfile" id="frm_insertProfile" method="post"
    action="admin_cp_insert_processor.asp">
    <table width="95%" border="1" cellspacing="0" cellpadding="3">
    <tr>
    <td width="40%">Region</td>
    <td width="60%">
    <select name="region" id="region">
    <%
    Do Until rs_regions.EOF
    Response.Write("<option value=""" & rs_regions("regionID") & """>" &
    rs_regions("regionName") & "</option>")
    rs_regions.MoveNext
    Loop
    %>
    </select>
    </td>
    </tr>
    <tr>
    <td>Country Name </td>
    <td><input name="countryName" type="text" id="countryName" /></td>
    </tr>
    <tr>
    <td>Population (Do not use commas) </td>
    <td><input name="population" type="text" id="population" /></td>
    </tr>
    <tr>
    <td>Country Currency </td>
    <td><input name="country_currency" type="text" id="country_currency"
    /></td>
    </tr>
    <tr>
    <td>Description</td>
    <td><textarea name="description" cols="55" rows="9" wrap="VIRTUAL"
    id="description"></textarea></td>
    </tr>
    <tr>
    <td>Image URL (Use this format:
    <strong>images/imagename.jpg</strong> and remember to upload the images to the
    images folder on the server)</td>
    <td><input name="imageURL" type="text" id="imageURL" /></td>
    </tr>
    <tr>
    <td>Image Alternate Description</td>
    <td><textarea name="imageALT" cols="55" wrap="VIRTUAL"
    id="imageALT"></textarea></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
    </table>
    </form>
    <p>&nbsp;</p>
    </td>
    </tr>
    </table>

    <br />
    <br />


    <map name="navbarMap" id="navbarMap">
    <area shape="rect" coords="1,0,62,20"
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/index.asp" alt="Home" />
    <area shape="rect" coords="71,0,117,20"
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/about.asp" alt="About" />
    <area shape="rect" coords="129,0,196,20"
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/tours.asp" alt="Find
    Tours" />
    <area shape="rect" coords="209,0,311,20"
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/profiles.asp"
    alt="Country Profiles" />
    <area shape="rect" coords="327,0,434,20"
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/contact.asp"
    alt="Contact An Agent" />
    </map>
    </body>
    </html>

    bennettian Guest

  2. Similar Questions and Discussions

    1. Database Insert Error
      :confused; I am inserting data into three tables, and the insert statements have a similar format but I get an error saying that I am Missing...
    2. how to insert data into database
      i already make a form and database with access...and now i want to know how the data will insert automatically into the database...another one, how...
    3. Insert into database error
      I get the following error when I load this page. ODBC Error Code = 37000 (Syntax error or access violation) Missing semicolon (;) at end of SQL...
    4. insert data into database
      :confused; Please help, I haven't got a clue what I am doing. I have a page that I wish people to enter data then submit it to a Microsoft SQL...
    5. Database insert puzzle
      I have three forms: Choose Login Enter company information Enter financial information ...in sequence where the data needs to go into the same...
  3. #2

    Default Re: Database Insert

    One thing is that all your URLs are accessing from a location on your
    computer that isn't a typical server location. Did you map this as a
    virtual directory? Also .. the file/// is typically a DMX thing before the
    page is saved so that's weird.

    What is your error message?


    --
    Nancy Gill
    Team Macromedia Volunteer for Dreamweaver MX/UltraDev
    [url]http://www.macromedia.com/go/team/[/url]
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004: A Beginner's
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web Development

    "bennettian" <webforumsuser@macromedia.com> wrote in message
    news:d6fe0k$lcg$1@forums.macromedia.com...
    > Is there anybody out there who has worked through the Jeffrey Bardzell
    book
    > "Dreamweaver MX 2004 with asp, Coldfusion and php"?
    > By various means I have reached the end of the book but the only thing
    that
    > refuses to work is Lesson 16 "Inserting a new Country Profile". I have
    repeated
    > this exercise many times now - even inserting code from the book's CD but
    it
    > just won't work.
    > After completing the form I press Submit and am told that the page
    requested
    > cannot be displayed.
    > If there is anybody who could cast an eye over the code or who knows
    about an
    > inherent problem I should be more than grateful.
    > CODE:
    > <%@LANGUAGE="VBSCRIPT"%>
    > <%
    > ' *** Restrict Access To Page: Grant or deny access to this page
    > MM_authorizedUsers="admin"
    >
    MM_authFailedURL="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/login.asp
    "
    > MM_grantAccess=false
    > If Session("MM_Username") <> "" Then
    > If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
    > (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1)
    Then
    > MM_grantAccess = true
    > End If
    > End If
    > If Not MM_grantAccess Then
    > MM_qsChar = "?"
    > If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    > MM_referrer = Request.ServerVariables("URL")
    > if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer &
    "?" &
    > Request.QueryString()
    > MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    > Server.URLEncode(MM_referrer)
    > Response.Redirect(MM_authFailedURL)
    > End If
    > %>
    >
    > <%
    > 'Create connection object
    > Dim dbConn
    > Dim rs_regions
    > set dbConn = server.CreateObject("adodb.connection")
    > 'Connect to database via DSN
    > dbConn.open("newland")
    > Set rs_regions = dbConn.Execute("SELECT * FROM tbl_region ORDER BY
    regionName")
    > %>
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="http://www.w3.org/1999/xhtml">
    > <head>
    > <title>Newland Tours: Admin Insert a Country Profile</title>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
    />
    > <link
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/css/newland.css"
    > rel="stylesheet" type="text/css" />
    > </head>
    >
    > <body>
    > <a href="#top"><img
    > src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/spacer.gif"
    > alt="Skip to main page content." width="1" height="1" border="0"
    align="left"
    > /></a>
    > <table width="750" border="0" cellpadding="3" cellspacing="0">
    > <tr>
    > <td width="470"><img
    >
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_left.gif
    "
    > width="451" height="68" alt="Newland Tours Banner, Left" /></td>
    > <td width="280"><img
    >
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_right.jp
    g"
    > width="276" height="68" alt="Newland Tours Banner, Right" /></td>
    > </tr>
    > <tr>
    > <td><img
    > src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/navbar.gif"
    > name="navbar" width="450" height="20" border="0" usemap="#navbarMap"
    > alt="Navigation Bar" /></td>
    > <td><img name="copyright_bar"
    >
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/copyright_bar.g
    if"
    > width="272" height="20" border="0" alt="Copyright 2004 Newland Tours"
    /></td>
    > </tr>
    > <tr>
    > <td colspan="2">
    > <h1><br />
    > <a name="top" id="top"></a>Insert a New Country Profile </h1>
    > <form name="frm_insertProfile" id="frm_insertProfile" method="post"
    > action="admin_cp_insert_processor.asp">
    > <table width="95%" border="1" cellspacing="0" cellpadding="3">
    > <tr>
    > <td width="40%">Region</td>
    > <td width="60%">
    > <select name="region" id="region">
    > <%
    > Do Until rs_regions.EOF
    > Response.Write("<option value=""" & rs_regions("regionID") & """>" &
    > rs_regions("regionName") & "</option>")
    > rs_regions.MoveNext
    > Loop
    > %>
    > </select>
    > </td>
    > </tr>
    > <tr>
    > <td>Country Name </td>
    > <td><input name="countryName" type="text" id="countryName"
    /></td>
    > </tr>
    > <tr>
    > <td>Population (Do not use commas) </td>
    > <td><input name="population" type="text" id="population"
    /></td>
    > </tr>
    > <tr>
    > <td>Country Currency </td>
    > <td><input name="country_currency" type="text"
    id="country_currency"
    > /></td>
    > </tr>
    > <tr>
    > <td>Description</td>
    > <td><textarea name="description" cols="55" rows="9"
    wrap="VIRTUAL"
    > id="description"></textarea></td>
    > </tr>
    > <tr>
    > <td>Image URL (Use this format:
    > <strong>images/imagename.jpg</strong> and remember to upload the images to
    the
    > images folder on the server)</td>
    > <td><input name="imageURL" type="text" id="imageURL" /></td>
    > </tr>
    > <tr>
    > <td>Image Alternate Description</td>
    > <td><textarea name="imageALT" cols="55" wrap="VIRTUAL"
    > id="imageALT"></textarea></td>
    > </tr>
    > <tr>
    > <td>&nbsp;</td>
    > <td><input type="submit" name="Submit" value="Submit" /></td>
    > </tr>
    > </table>
    > </form>
    > <p>&nbsp;</p>
    > </td>
    > </tr>
    > </table>
    >
    > <br />
    > <br />
    >
    >
    > <map name="navbarMap" id="navbarMap">
    > <area shape="rect" coords="1,0,62,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/index.asp"
    alt="Home" />
    > <area shape="rect" coords="71,0,117,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/about.asp"
    alt="About" />
    > <area shape="rect" coords="129,0,196,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/tours.asp"
    alt="Find
    > Tours" />
    > <area shape="rect" coords="209,0,311,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/profiles.asp"
    > alt="Country Profiles" />
    > <area shape="rect" coords="327,0,434,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/contact.asp"
    > alt="Contact An Agent" />
    > </map>
    > </body>
    > </html>
    >

    Nancy Gill Guest

  4. #3

    Default Re: Database Insert

    Have you looked here [url]http://www.allectomedia.com/dw_asp_cf_php_errata.htm[/url] on
    the errate site - maybe you can find a solution here.

    /Tine


    "bennettian" <webforumsuser@macromedia.com> skrev i en meddelelse
    news:d6fe0k$lcg$1@forums.macromedia.com...
    > Is there anybody out there who has worked through the Jeffrey Bardzell
    book
    > "Dreamweaver MX 2004 with asp, Coldfusion and php"?
    > By various means I have reached the end of the book but the only thing
    that
    > refuses to work is Lesson 16 "Inserting a new Country Profile". I have
    repeated
    > this exercise many times now - even inserting code from the book's CD but
    it
    > just won't work.
    > After completing the form I press Submit and am told that the page
    requested
    > cannot be displayed.
    > If there is anybody who could cast an eye over the code or who knows
    about an
    > inherent problem I should be more than grateful.
    > CODE:
    > <%@LANGUAGE="VBSCRIPT"%>
    > <%
    > ' *** Restrict Access To Page: Grant or deny access to this page
    > MM_authorizedUsers="admin"
    >
    MM_authFailedURL="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/login.asp
    "
    > MM_grantAccess=false
    > If Session("MM_Username") <> "" Then
    > If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
    > (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1)
    Then
    > MM_grantAccess = true
    > End If
    > End If
    > If Not MM_grantAccess Then
    > MM_qsChar = "?"
    > If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    > MM_referrer = Request.ServerVariables("URL")
    > if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer &
    "?" &
    > Request.QueryString()
    > MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    > Server.URLEncode(MM_referrer)
    > Response.Redirect(MM_authFailedURL)
    > End If
    > %>
    >
    > <%
    > 'Create connection object
    > Dim dbConn
    > Dim rs_regions
    > set dbConn = server.CreateObject("adodb.connection")
    > 'Connect to database via DSN
    > dbConn.open("newland")
    > Set rs_regions = dbConn.Execute("SELECT * FROM tbl_region ORDER BY
    regionName")
    > %>
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="http://www.w3.org/1999/xhtml">
    > <head>
    > <title>Newland Tours: Admin Insert a Country Profile</title>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
    />
    > <link
    href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/css/newland.css"
    > rel="stylesheet" type="text/css" />
    > </head>
    >
    > <body>
    > <a href="#top"><img
    > src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/spacer.gif"
    > alt="Skip to main page content." width="1" height="1" border="0"
    align="left"
    > /></a>
    > <table width="750" border="0" cellpadding="3" cellspacing="0">
    > <tr>
    > <td width="470"><img
    >
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_left.gif
    "
    > width="451" height="68" alt="Newland Tours Banner, Left" /></td>
    > <td width="280"><img
    >
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_right.jp
    g"
    > width="276" height="68" alt="Newland Tours Banner, Right" /></td>
    > </tr>
    > <tr>
    > <td><img
    > src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/navbar.gif"
    > name="navbar" width="450" height="20" border="0" usemap="#navbarMap"
    > alt="Navigation Bar" /></td>
    > <td><img name="copyright_bar"
    >
    src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/copyright_bar.g
    if"
    > width="272" height="20" border="0" alt="Copyright 2004 Newland Tours"
    /></td>
    > </tr>
    > <tr>
    > <td colspan="2">
    > <h1><br />
    > <a name="top" id="top"></a>Insert a New Country Profile </h1>
    > <form name="frm_insertProfile" id="frm_insertProfile" method="post"
    > action="admin_cp_insert_processor.asp">
    > <table width="95%" border="1" cellspacing="0" cellpadding="3">
    > <tr>
    > <td width="40%">Region</td>
    > <td width="60%">
    > <select name="region" id="region">
    > <%
    > Do Until rs_regions.EOF
    > Response.Write("<option value=""" & rs_regions("regionID") & """>" &
    > rs_regions("regionName") & "</option>")
    > rs_regions.MoveNext
    > Loop
    > %>
    > </select>
    > </td>
    > </tr>
    > <tr>
    > <td>Country Name </td>
    > <td><input name="countryName" type="text" id="countryName"
    /></td>
    > </tr>
    > <tr>
    > <td>Population (Do not use commas) </td>
    > <td><input name="population" type="text" id="population"
    /></td>
    > </tr>
    > <tr>
    > <td>Country Currency </td>
    > <td><input name="country_currency" type="text"
    id="country_currency"
    > /></td>
    > </tr>
    > <tr>
    > <td>Description</td>
    > <td><textarea name="description" cols="55" rows="9"
    wrap="VIRTUAL"
    > id="description"></textarea></td>
    > </tr>
    > <tr>
    > <td>Image URL (Use this format:
    > <strong>images/imagename.jpg</strong> and remember to upload the images to
    the
    > images folder on the server)</td>
    > <td><input name="imageURL" type="text" id="imageURL" /></td>
    > </tr>
    > <tr>
    > <td>Image Alternate Description</td>
    > <td><textarea name="imageALT" cols="55" wrap="VIRTUAL"
    > id="imageALT"></textarea></td>
    > </tr>
    > <tr>
    > <td>&nbsp;</td>
    > <td><input type="submit" name="Submit" value="Submit" /></td>
    > </tr>
    > </table>
    > </form>
    > <p>&nbsp;</p>
    > </td>
    > </tr>
    > </table>
    >
    > <br />
    > <br />
    >
    >
    > <map name="navbarMap" id="navbarMap">
    > <area shape="rect" coords="1,0,62,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/index.asp"
    alt="Home" />
    > <area shape="rect" coords="71,0,117,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/about.asp"
    alt="About" />
    > <area shape="rect" coords="129,0,196,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/tours.asp"
    alt="Find
    > Tours" />
    > <area shape="rect" coords="209,0,311,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/profiles.asp"
    > alt="Country Profiles" />
    > <area shape="rect" coords="327,0,434,20"
    > href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/contact.asp"
    > alt="Contact An Agent" />
    > </map>
    > </body>
    > </html>
    >

    Tine Müller Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139