Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ODBC DSNless connection

Guest
Mar 20, 2007 Mar 20, 2007
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?
TOPICS
Server side applications
443
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2007 Mar 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?
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 20, 2007 Mar 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2007 Mar 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?
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 21, 2007 Mar 21, 2007
would it make a difference if my testing server was the same as the remote, rather than on my local machine?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 21, 2007 Mar 21, 2007
LATEST
since I use my host as the the testing server, i never have problems with connection strings (dsn less)...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines