Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 04-06-2009, 02:45 AM   #1
Join Date: Apr 2009
Posts: 1
Default Another Newb Pleading for help

I have started working through Mastering Dreamweaver MX Databases and when I test the database connection all seems ok.

I have created the 2 files below from the tutorial (cut and paste )but keep getting errors and not the results that are expected. If someone has a moment to have a look I would very much apreciate it. I am not sure if I just have not set up the connection correctly or if there is an error in the script. Its a bit frustrating when the first basic tutorial fails

(This uses the MS Access Northwind.mdb database)

Listing 4.2: CH4LIST2.ASP
<title>Chapter 4, Listing 2 Example</title>



<form name="frmChapter4Listing2" method="post" action="ch4list3.asp" >

<p> Enter the customer's name and then click the Submit button to see a list of orders. <p>

<tr>...<td width="45%">Customer </td>...<input type="text" name="txtcompanyname"> </tr>

...<input type="submit" name="Submit" value="Submit"> </form>...

Listing 4.3: CH4LIST3.ASP

Dim companyname
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "nwindDSN"
companyname = Request.Form("txtcompanyname")
SQL = "SELECT Customers.CompanyName, Orders.OrderID
FROM Customers INNER JOIN Orders ON
Customers.CustomerID = Orders.CustomerID
WHERE CompanyName = '" & companyname
& "'" Set rst = Conn.Execute(SQL)
<%Do While Not rst.EOF%>
...<%Response.Write rst("CompanyName")%>&nbsp
...<%Response.Write rst("OrderID")%>

The error :

Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/ch4list3.asp, line 6, column 51
SQL = "SELECT Customers.CompanyName, Orders.OrderID

Pedro is offline   Reply With Quote
Old 04-06-2009, 02:49 PM   #2
mangofreak's Avatar
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444

Check here for the reason of your error:

scroll down the page and look for your error number
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:51 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com