Forums

This topic is locked

Dream Weaver 8 Connection Strings for MSAccess DB

Posted 12 Feb 2007 00:39:22
1
has voted
12 Feb 2007 00:39:22 Anand Dulare posted:
Hi

Im using Dream Weaver 8 to create a set of ASP and ASPX websites im editing them locally and testing them locally using IIS Personal Web Server. My problem is how to transfer them on to a remote webserver and make the pages connect to a remote database for asp,aspx as they work fine Locally ?

Does anyone know how to create Dreamweaver connection strings for both ASP and ASP.NET pages for database that has the following directory path on the remote webserver

Domain = asianwedding.somee.com
Database path = asianwedding.somee.com\customer\DataBase\db1.mdb

Ive been searching on the web and using the Server.map and DNS Less connections but they have failed to work
any help on creating remote database strings using DREAMWEAVER 8 for both ASP and ASP.NET would be greatly apperciated.

What Im trying to do as a test page is to load up a simple datagrid displaying the records in a table to see if the page can connect to the remote database stored in the folder ......./Database/db1.mdb


The folloing error message is reported back by the webserver

System.Data.OleDb.OleDbException: 'c:\windows\system32\inetsrv\asianwedding.somee.com\customer\DataBase\db1.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at DreamweaverCtrls.DataSet.DoInit()


Any help would be GREATLY !!!!! Apperciated !!!!

Anand UK

Replies

Replied 13 Feb 2007 01:49:17
13 Feb 2007 01:49:17 Charles Knight replied:
Open a page in DW, goto application, then databases, then add custom connection string.

Give your connection a name (no spaces or funny characters allowed)

Then add the line below:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/customer/DataBase/db1.mdb"

check "Use driver on testing server" and then try and test.

If DW comes back OK your done, if not then use the error to work out whats going wrong.

One final point, make sure you change your db name as you have now told everyone where it can be found and its name!!!!, may change the folder names too...

DW8 | ASP | ACCESS
Replied 13 Feb 2007 16:39:50
13 Feb 2007 16:39:50 Anand Dulare replied:

Hi

Charlie K

I would like to thank you for taking the time to reply to my problem and very grateful Ive tried the customer connection string using a standard asp page.

I now get CONNECTION MADE SUCCESSFUL !!!

I think i forgot to enter my testing server details correctly in the site definition the first time I tried the connection string it came up with a URL prefix error so I corrected that and it WORKED !!!.

I was able to also find the connection string for my ASP.NET pages (.aspx) by opening up a standard asp page called default.asp and inserting the following code.


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<%Response.Write("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("DataBase/db1.mdb")%>



</body>
</html>

when I lauched the page in my webbrowser which executed the page on the remote (asianweddings.somee.com) server it game me the following full path which I requested from my websever provider which they didnt give me.

DRIVER={Microsoft Access Driver (*.mdb)};DBQ=e:\DZHosts\LocalUser\ADulare\asianwedding.somee.com\customer\DataBase\db1.mdb

I then used this DNS connection string to connect my default.aspx (ASP.NET) page to my remote database.

So Ive learnt thanks to you how to connect to a remote MS Access database using two connection strings for asp and asp.net

Regards
Anand UK

Oopps nearly forgot to change my database name thanks again ive being going mad for the last few days.

I think the next version of Dreamweaver should have more support for remote connections as the local connections they have templates and builder options.





Replied 13 Feb 2007 23:01:34
13 Feb 2007 23:01:34 Anand Dulare replied:
Hi

Charlie

Ive managed to add your server.map customer string also into the page so to find the other alternative DSN less connection string using then Microsoft JET OLEDB driver. To give me full directory path to the remote database.

Here is the final code other Dream Weaver users who are viewing this code should just simply follow these instructions to find the strings for the driver that your webserver supports.

1. Simply insert the following code into dreamweaver 8 and creating a standard asp page called default.asp

2. upload the file into your website folder just outside the database folder.

3. Execute the page into your webbroswer make sure your remote and testing server points to your FTP settings used to access your remote webserver and the URL prefix map to the following: www.yourdomain.com/yourwebsitefolder/


4. Copy and paste the database connection strings from default.asp into DreamWeaver exactly for both
ASP (Custom String) and for ASP.NET (OLEDB connection) give the connection something meaninful
like RemoteDB or something

Here is the code to insert into default.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<%Response.Write("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("DataBase/db1.mdb")
%>
 
<%Response.Write"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/customer/DataBase/db1.mdb"%>



</body>
</html>


Replace Customer and DataBase folder with your own respective folders to define your website and database folders i.e /YourwebsiteFolder/YourDatabaseFolder/YourDatabaseFileName

Hope that helps its been fun learning how to connect and configure remote connection strings to MSAccess.

Thanks again to Charlie

Regards

Anand UK <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic