Skip to main content
March 20, 2007
Question

ODBC DSNless connection

  • March 20, 2007
  • 4 replies
  • 442 views
I created some ASP pages for a database and while onmy local machine everything was good.
When uploaded to my host the connection failed and they suggested a DSNless connection, i reasearched it on the net and there were several tutorials but none of them worked.
The current connection is
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_tracks_STRING = "dsn=tracks;"

and the link on the ASP pages is
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/tracks.asp" -->
<%
var rstracks_cmd = Server.CreateObject ("ADODB.Command");
rstracks_cmd.ActiveConnection = MM_tracks_STRING;
rstracks_cmd.CommandText = "SELECT * FROM tracks ORDER BY Suburb ASC";
rstracks_cmd.Prepared = true;

var rstracks = rstracks_cmd.Execute();
var rstracks_numRows = 0;
%>

Can anyone help me modify this to get it working?
This topic has been closed for replies.

4 replies

March 21, 2007
would it make a difference if my testing server was the same as the remote, rather than on my local machine?
March 21, 2007
since I use my host as the the testing server, i never have problems with connection strings (dsn less)...
Inspiring
March 20, 2007
http://www.basic-ultradev.com/articles/ADOConnections/

--
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com


"XaeroRamirez" <webforumsuser@macromedia.com> wrote in message news:etogvc$djt$1@forums.macromedia.com...
> Thanks Ken,
>
> It still isn't working though, i'm not sure if my site host is giving me the
> full address, i have seen that in some strings you can have the string map the
> path to the database file.
> it is all i can really put it down to, how can i make this modification?
>
March 20, 2007
Thanks Ken,

It still isn't working though, i'm not sure if my site host is giving me the full address, i have seen that in some strings you can have the string map the path to the database file.
it is all i can really put it down to, how can i make this modification?
Inspiring
March 20, 2007
replace this:

<!--#include file="Connections/tracks.asp" -->

With this:

<%
Dim MM_tracks_STRING
MM_tracks_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SomeFolder\SomeDatabase.mdb;"
%>

Be sure to keep the MM_tracks_STRING = line on one line

--
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com


"XaeroRamirez" <webforumsuser@macromedia.com> wrote in message news:eto73e$29c$1@forums.macromedia.com...
>I created some ASP pages for a database and while onmy local machine everything
> was good.
> When uploaded to my host the connection failed and they suggested a DSNless
> connection, i reasearched it on the net and there were several tutorials but
> none of them worked.
> The current connection is
> // FileName="Connection_odbc_conn_dsn.htm"
> // Type="ADO"
> // DesigntimeType="ADO"
> // HTTP="false"
> // Catalog=""
> // Schema=""
> var MM_tracks_STRING = "dsn=tracks;"
>
> and the link on the ASP pages is
> <%@LANGUAGE="JAVASCRIPT"%>
> <!--#include file="Connections/tracks.asp" -->
> <%
> var rstracks_cmd = Server.CreateObject ("ADODB.Command");
> rstracks_cmd.ActiveConnection = MM_tracks_STRING;
> rstracks_cmd.CommandText = "SELECT * FROM tracks ORDER BY Suburb ASC";
> rstracks_cmd.Prepared = true;
>
> var rstracks = rstracks_cmd.Execute();
> var rstracks_numRows = 0;
> %>
>
> Can anyone help me modify this to get it working?
>