Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 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 July 21st, 2007, 12:16 PM
Authorized User
 
Join Date: Mar 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure enough, they do have MS ACCESS DSN-less connection for MS Access support. The string they provide is

"PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("../databases/YOURDATABASE.mdb")

They provide defining paths:
Server.MapPath("/") equates to "\domain.com\public\"
Server.MapPath("/images") equates to "\domain.com\public\images"

Which I take to mean that I need to embed my site into another folder named "public".

Now, they have the following on making a database connection and viewing data...

---
Set conn = Server.CreateObject("ADODB.Connection")

Conn.Open {insert your DSN-less connection}

Set ObjRs = Server.CreateObject("ADODB.Recordset")
strSQL = "select columnname from table"
objRS.open strSQL, Conn
Do While Not objRs.EOF
     response.write(objRS("columnname") & "<br>")
     objRS.MoveNext
Loop
conn.close
set conn = nothing
---
Cross-referencing the above to TheSoccerSite connections page, I think I'd need to revise the code to correspond to what's given above. (Is this right?... and where in relationship to the "Dim MM_connTheSoccerSite_STRING
MM_connTheSoccerSite_STRING =..." lines?)

Thanx.


 
Old July 21st, 2007, 04:49 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In TheSoccerSite, the connection string is defined in the Connections folder in the file connTheSoccerSite. By default it looks like this:

MM_connTheSoccerSite_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\Webroot\TheSoccerSite\Data
base\TheSoccerSite.mdb;"

You need to replace the physical path with the dynamic part, like this:

MM_connTheSoccerSite_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & DynamicPart & ";"

Depending on where your database resides, DynamicPart can be something like:

Server.MapPath("/databases/YOURDATABASE.mdb")

assuming you have your database in a folder called databases in the root.

Does this help?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old July 23rd, 2007, 07:30 PM
Authorized User
 
Join Date: Mar 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

"The host is found" and after "Waiting for server...", I have a message that says "[Microsoft][ODBC Driver Manager] Data source name too long". I renamed the site to "TSS" and the database to "TSS.mdb" The message "Testing database connection..." flashed for less than a second but the database tables, etc. are still not showing in the Applications submenu of the Databases menu...
Definitely progress, but I'm trying to figure out what's keeping it from reading the database file
 
Old July 24th, 2007, 12:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Where are you encountering this? Run-time or design-time?

If you write the connection string using Server.MapPath, it only works at run-time, not at design time anymore.

For design-time, you can use a local connection string. Then when you're ready to roll-out, upload the database, but not the connecting string files.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
page 565- Building your first site. lanzetta BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 May 18th, 2006 08:41 PM
chapter 13 building an index page drb2k2 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 March 5th, 2006 07:22 PM
building blocks "Content creation page" terry s Dreamweaver (all versions) 0 February 15th, 2005 02:01 PM
building blocks (page 562) terry s Dreamweaver (all versions) 1 January 13th, 2005 02:10 PM





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