Ask a Question related to Dreamweaver AppDev, Design and Development.
-
bennettian #1
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> </td>
<td><input type="submit" name="Submit" value="Submit" /></td>
</tr>
</table>
</form>
<p> </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
-
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... -
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... -
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... -
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... -
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... -
Nancy Gill #2
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...book> Is there anybody out there who has worked through the Jeffrey Bardzellthat> "Dreamweaver MX 2004 with asp, Coldfusion and php"?
> By various means I have reached the end of the book but the only thingrepeated> refuses to work is Lesson 16 "Inserting a new Country Profile". I haveit> this exercise many times now - even inserting code from the book's CD butrequested> just won't work.
> After completing the form I press Submit and am told that the pageabout an> cannot be displayed.
> If there is anybody who could cast an eye over the code or who knowsMM_authFailedURL="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/login.asp> 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"
>
"Then> 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)"?" &> 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 ®ionName")> 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/>> %>
>
> <!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"href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/css/newland.css"> <linkalign="left"> 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"src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_left.gif> /></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_right.jp> width="451" height="68" alt="Newland Tours Banner, Left" /></td>
> <td width="280"><img
>
g"src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/copyright_bar.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"
>
if"/></td>> 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"id="country_currency"> </tr>
> <tr>
> <td>Country Currency </td>
> <td><input name="country_currency" type="text"wrap="VIRTUAL"> /></td>
> </tr>
> <tr>
> <td>Description</td>
> <td><textarea name="description" cols="55" rows="9"the> id="description"></textarea></td>
> </tr>
> <tr>
> <td>Image URL (Use this format:
> <strong>images/imagename.jpg</strong> and remember to upload the images toalt="Home" />> 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> </td>
> <td><input type="submit" name="Submit" value="Submit" /></td>
> </tr>
> </table>
> </form>
> <p> </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="About" />> <area shape="rect" coords="71,0,117,20"
> href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/about.asp"alt="Find> <area shape="rect" coords="129,0,196,20"
> href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/tours.asp"> 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
-
Tine Müller #3
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...book> Is there anybody out there who has worked through the Jeffrey Bardzellthat> "Dreamweaver MX 2004 with asp, Coldfusion and php"?
> By various means I have reached the end of the book but the only thingrepeated> refuses to work is Lesson 16 "Inserting a new Country Profile". I haveit> this exercise many times now - even inserting code from the book's CD butrequested> just won't work.
> After completing the form I press Submit and am told that the pageabout an> cannot be displayed.
> If there is anybody who could cast an eye over the code or who knowsMM_authFailedURL="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/login.asp> 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"
>
"Then> 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)"?" &> 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 ®ionName")> 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/>> %>
>
> <!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"href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/css/newland.css"> <linkalign="left"> 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"src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/banner_left.gif> /></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_right.jp> width="451" height="68" alt="Newland Tours Banner, Left" /></td>
> <td width="280"><img
>
g"src="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/images/copyright_bar.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"
>
if"/></td>> 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"id="country_currency"> </tr>
> <tr>
> <td>Country Currency </td>
> <td><input name="country_currency" type="text"wrap="VIRTUAL"> /></td>
> </tr>
> <tr>
> <td>Description</td>
> <td><textarea name="description" cols="55" rows="9"the> id="description"></textarea></td>
> </tr>
> <tr>
> <td>Image URL (Use this format:
> <strong>images/imagename.jpg</strong> and remember to upload the images toalt="Home" />> 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> </td>
> <td><input type="submit" name="Submit" value="Submit" /></td>
> </tr>
> </table>
> </form>
> <p> </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="About" />> <area shape="rect" coords="71,0,117,20"
> href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/about.asp"alt="Find> <area shape="rect" coords="129,0,196,20"
> href="file:///D|/LESSONS/LESSON16/COMPLETE/NEWLAND-ASP/tours.asp"> 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



Reply With Quote

