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 10th, 2004, 06:39 PM
Friend of Wrox
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection String

I have always manually typed in connection strings in my ASP pages, which looks like this:

Set conn = Server.CreateObject("ADODB.Connection")
cnpath="DBQ=" & server.mappath("classifications_studies.mdb")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath

I am now trying to use DreamWeaver MX's database tool to do this. The Wrox book I bought ask me to type this:

"Provider =microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\database_name"

in the "Connection String" textbox when the "Custom Connection String" window pops up. The problem is, I have a remote server, instead of a local path. I tried incorporating my own string list above instead of the one shown in the book. But when I clicked on "Test COnnection," I get a path c:\hrftp\leont\..... path not found.

I don't get it. Is there another way to create a connection so DW MX can understand, instead of using their buil-in connection tool? If not, what should I type into the "Connection String" text box based on my connection string i have given u above?

Thank you.


Old February 11th, 2004, 05:14 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

When you say Remote Server, are you referring to a machine in your network? If so, you can use a UNC path. e.g. \\MyMachine\MyShare\MyFile.mdb.

If your remote server is reached over FTP, you're in trouble ;) You can't really expect DW to understand a connection string that is supposed to run on another machine reached over FTP. In that case, I suggest you use a local connection string that points to a local database for development time. This allows you to test and use the database on your local machine. You can use a hardcoded path (e.g. C:\Databases\MyFile.mdb) or fake a path and use Server.MapPath to get the real path.

The advantage of the second method is that your local string could be the same as the remote string, so you don't have to change anything when you sync your site.
With a different local string, you have to make sure you are not accidentally overwriting the remote version.

You may want to check out this thread for more ideas.



Imar Spaanjaars
Everyone is unique, except for me.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection string MunishBhatia ASP.NET 2.0 Professional 4 May 16th, 2007 05:50 AM
Connection String jmss66 Oracle 4 August 8th, 2006 03:19 AM
Connection String slgknjn VB Databases Basics 2 February 26th, 2005 03:14 AM
Connection String fs22 Classic ASP Databases 3 August 30th, 2004 01:25 AM
Connection String Help. diamond2165 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 7th, 2003 06:09 AM

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