Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) 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 February 9th, 2007, 02:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Mike,

Yes, you do.

However, what you need to change is hard to suggest for me, as it depends on your host. Some hosts store the database outside the web root and give you a DSN to work with. With others, the database is stored within the webroot, so you can access it using Server.MapPath:

Instead of:

C:/Inetpub/wwwroot/mysite/mysite.mdb

you could try this:

Server.MapPath("/Database") & "/mysite.mdb"

This "maps" the virtual root path Database to a physical folder, like:

c:\Users\MikeC\webroot\Database

If that doesn't help, contact your host, as only they know about your setup.

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.
 
Old February 9th, 2007, 02:17 PM
Authorized User
 
Join Date: Jan 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar

Thanks for that just to make sure I have this right...
At the moment in the connections folder I have Mysite.asp and in there I have
'Driver=(Microsoft AccessDriver*.mdb)};DBQ=C:\\Inetpub\wwwroot\Mysite \Mysite.mbd;'

So I should try 'Driver=(Microsoft Access Driver (*.mdb)};DBQ=Server.MapPath("/Database") & "/mysite.mdb"
Would Database be my connections folder
Is this correct.

Mike

 
Old February 9th, 2007, 02:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, almost and sort off.... It all depends on *where* your database resides.

If you have it in the root, use MapPath("/"). If it's in a folder called Database, use MapPath("/Database/")

Also, you can't hard code it in the string. It needs to be executable ASP. So, if you have something like this in connection.asp:

connString = "Driver=(Microsoft AccessDriver*.mdb)};DBQ=C:\\Inetpub\wwwroot\Mysite \Mysite.mbd;"

change it to:

connString = "Driver=(Microsoft AccessDriver*.mdb)};DBQ=" & Server.MapPath("/") & "/Mysite.mbd;"

But to be absolutely sure: check your host. Usually they have FAQs or a support center that explains what to do.....

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 February 9th, 2007, 02:36 PM
Authorized User
 
Join Date: Jan 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Connections folder is in the root ie /Htdocs/connections/mysite.mdb Sorry about this but being away for so long I have totally lost my train of thought with this site. I have been onto my support contact and I am getting no where fast with him! hence any help I can get from my reliable friend would be greatly appreciated... would there be any other pages I would need to alter in the site.


Mike

 
Old February 9th, 2007, 03:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If Connections is in the virtual root of the site (e.g. www.yourdomain.com/Connections/ exists, then this should work:

connString = "Driver=(Microsoft AccessDriver*.mdb)};DBQ=" & Server.MapPath("/Connections") & "/Mysite.mdb;"

Notice that earlier you posted a connection string with mbd, not mdb

If that doesn't help, can you explain more about the situation? E.g. do you get an error?

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 February 9th, 2007, 03:32 PM
Authorized User
 
Join Date: Jan 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar

Thanks for all that, the mbd was just my finger pushing wrong key here on the site it is mdb will check this out on the server now,,, fingers crossed.

Mike

 
Old February 9th, 2007, 03:55 PM
Authorized User
 
Join Date: Jan 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar
This is the lines that are in the page Mysite.asp
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_mysite_STRING = "Driver=(Microsoft Access Driver*.mdb)};DBQ=" & Server.MapPath("/") & "/TheWatchCompany.mdb;"
%>

And this is the page Error I am Getting


Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'var'
/thewatchcompany/Connections/TheWatchCompany.asp, line 8


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Page:
GET /thewatchcompany/Connections/TheWatchCompany.asp

Any Ideas

Mike

 
Old February 9th, 2007, 03:58 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Your code is using JavaScript (with keywords like var) while the error message seems to suggest VB Script is used.

What language is the site written in?

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
While typing this post, I was listening to: La La Land by Green Velvet (Track 1 from the album: La La Land) What's This?
 
Old February 9th, 2007, 04:02 PM
Authorized User
 
Join Date: Jan 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The site is written in the language that the book told me to asp javascript

Mike

 
Old February 9th, 2007, 04:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Two thirds of the book is in VB Script, not JavaScript.... ;)

Anyway, do your pages have this on the top:

<% @LANGUAGE="JAVASCRIPT" %>



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
While typing this post, I was listening to: Knob Adjustment by Son Kite (From the album: Goa-Head Vol.9) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Pop-Up Menu in DW MX 2004 Maverick Dreamweaver (all versions) 5 November 20th, 2004 12:08 PM
Reading XML in DW MX 2004 bommi_k Dreamweaver (all versions) 1 August 19th, 2004 01:07 PM





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