Skip to main content
August 28, 2011
Question

Going from system DSN to DSN-less connection

Hello,

This is my first time developing a dynamic site. I'm working with Dreamweaver MX, using ASP and VBScript, and a Microsoft Access database. I was working with a local server using a system DSN and everything was working well. But now I'm trying to host this website in a remote server, to which I have no physical access, and do not know the full path of my "root folder". So I went back to Dreamweaver, thinking it would be really easy to change to a DSN-less connection by simply edditing the Connections file... here problems begin.

My connection string looks like this:

"Provider=Microsoft.Jet.OLEDB.4.0;Driver={Microsoft Access Driver(*.mdb)}; Data Source =" & Server.MapPath("\db\db2.mdb") & "UserID=;Password=;"

My connection file (connEIN.asp, included in all my asp files) looks like this right now:

<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_connEIN_STRING
MM_connEIN_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Driver={Microsoft Access Driver(*.mdb)}; Data Source =" & Server.MapPath("\db\db2.mdb") & "UserID=;Password=;"
%>

These are the errors I get:

1 - while oppening an .asp file in Dreamweaver: "The DynamicSelectList script does not define the findServerBehavior function."

2 - while testing the connection in Dreamweaver, or in a browser: "Microsoft JET Database Engine (0x80004005)
Could not find installable ISAM."

Things I've tryed and failed:

a) I've also used DBQ instead of Data Source, but it does not seem to make any difference.

b) I've also tryed erasing Server.MapPath, and writing the full path (since I'm now working in a local server I control), but it still doesn't work.

c) I've also tryed rewriting my connection file into this format after reading some scatered foruns, but it didn't work either:

<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_connEIN_STRING
set MM_connEIN_STRING = Server.CreateObject("ADODB.Connection")
MM_connEIN_STRING.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0"
conn = "Driver={Microsoft Access Driver(*.mdb)};DBQ =" & Server.MapPath("/einservices/db/db2.mdb")
MM_connEIN_STRING.Open conn
%>

I've wasted hours browsing and searching for an answer, and trying tinny changes. I would really appreciate help from someone who has successfully changed from a system DSN to a DSN-less connection.

Thanks in advance!

Ce sujet a été fermé aux réponses.

1 commentaire

Participating Frequently
August 28, 2011

A dsn-less connection should be as simple as:

MM_AccessTest_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/site1/database/mdbtest.mdb")

I believe you NEED to use forward slashes, not backslashes.

Check to see if MMHTTPDB.asp has been uploaded into your _mmServerScripts folder.

And before proceeding too far, are you sure you want to go with MS Access? You do realize it will only work for sites with very small volumes as it does not handle concurrent connections very well.

Lon_Winters
Inspiring
August 28, 2011

Yes, some hosting providers are more MS Access friendly than Krueger. The DB file should not be in your site folder for security reasons, and the host shold give you easy acess to put it where it belongs and provide the correct path. And as mentioned, if you're on a windows platform, chances are they also provide MSSQL - very easy to convert your Access database into this.

August 29, 2011

Thank you both, Lon Winters and bregent for your feedback.

I'm gonna go ahead with MS Access because it's the only database I know

for now, and because I don't expect a lot of traffic in the begining. I

hope it will allow me to test my site concept. If it becomes successfull, I

will think about "upgrade it" to another DB type.

Take care