Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2004, 06:39 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
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.

Leon


Reply With Quote
  #2 (permalink)  
Old February 11th, 2004, 05:14 AM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:02 AM.


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