p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Dreamweaver (all versions) (http://p2p.wrox.com/forumdisplay.php?f=58)
-   -   Connection String (http://p2p.wrox.com/showthread.php?t=9208)

phungleon February 10th, 2004 06:39 PM

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.

Leon



Imar February 11th, 2004 05:14 AM

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.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


All times are GMT -4. The time now is 07:18 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.