Forums

ASP

This topic is locked

Connection String to Access Database hosted on GoD

Posted 11 Dec 2006 11:07:55
1
has voted
11 Dec 2006 11:07:55 baloch dashti posted:
I built the site with Dreamweaver8, it works fine at my local computer, database connection error shows after upload it to godaddy.com server. I have a file inside the "Connections" folder which record the data connection infomation every time I config the connection, the file as follow:
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_connections4_STRING
MM_connections4_STRING ="Driver={Microsoft Access Driver (*.mdb)};DBQ=sitename/access_db/database.mdb"
%>

The error on site is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x658c Thread 0x23e4 DBC 0x112593c Jet'.
/en/default.asp, line 9
On line 9 I have this code:
Recordset1_cmd.ActiveConnection = MM_connections4_STRING

After contacting to GoDaddy provided the following “example” of how to connect to an Access database: For URL please check help.godaddy.com/article.php?article_id=1039&topic_id,
Which is has to be placed to every asp pages that requesting access database.
<%
Dim oConn, oRs
Dim qry, connectstr, sDSNDir
Dim db_name, db_username, db_userpassword
Dim db_server, dsn_name

dsn_name = "your_dsn_name"
fieldname = "your_fieldname"
tablename = "your_tablename"

sDSNDir = Server.MapPath("_dsn"

connectstr = "filedsn=" & sDSNDir & "\" & dsn_name

Set oConn = Server.CreateObject("ADODB.Connection"
oConn.Open connectstr
qry = "SELECT * FROM " & tablename

Set oRS = oConn.Execute(qry)

if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & " "
oRS.movenext
wend
oRS.close
end if

Set oRs = nothing
Set oConn = nothing

%>


one you create DSN string connection on godaddy.com the name will become same as your access database
database: dataname.mdb
Like: DSN Name: dataname.dsn
Please anyone has the solution for this headache to help me

Thanks in advance….
Baloch


Edited by - balach on 11 Dec 2006 14:40:09

Replies

Replied 26 Feb 2007 02:11:07
26 Feb 2007 02:11:07 sham satrohan replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I built the site with Dreamweaver8, it works fine at my local computer, database connection error shows after upload it to godaddy.com server. I have a file inside the "Connections" folder which record the data connection infomation every time I config the connection, the file as follow:
&lt;%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_connections4_STRING
MM_connections4_STRING ="Driver={Microsoft Access Driver (*.mdb)};DBQ=sitename/access_db/database.mdb"
%&gt;

The error on site is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x658c Thread 0x23e4 DBC 0x112593c Jet'.
/en/default.asp, line 9
On line 9 I have this code:
Recordset1_cmd.ActiveConnection = MM_connections4_STRING

After contacting to GoDaddy provided the following “example” of how to connect to an Access database: For URL please check help.godaddy.com/article.php?article_id=1039&topic_id,
Which is has to be placed to every asp pages that requesting access database.
&lt;%
Dim oConn, oRs
Dim qry, connectstr, sDSNDir
Dim db_name, db_username, db_userpassword
Dim db_server, dsn_name

dsn_name = "your_dsn_name"
fieldname = "your_fieldname"
tablename = "your_tablename"

sDSNDir = Server.MapPath("_dsn"

connectstr = "filedsn=" & sDSNDir & "\" & dsn_name

Set oConn = Server.CreateObject("ADODB.Connection"
oConn.Open connectstr
qry = "SELECT * FROM " & tablename

Set oRS = oConn.Execute(qry)

if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & " "
oRS.movenext
wend
oRS.close
end if

Set oRs = nothing
Set oConn = nothing

%&gt;


one you create DSN string connection on godaddy.com the name will become same as your access database
database: dataname.mdb
Like: DSN Name: dataname.dsn
Please anyone has the solution for this headache to help me

Thanks in advance….
Baloch


Edited by - balach on 11 Dec 2006 14:40:09
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Replied 26 Feb 2007 02:12:05
26 Feb 2007 02:12:05 sham satrohan replied:
[did you get this to work? I have the same issue right now and not sure what to do]
I built the site with Dreamweaver8, it works fine at my local computer, database connection error shows after upload it to godaddy.com server. I have a file inside the "Connections" folder which record the data connection infomation every time I config the connection, the file as follow:
&lt;%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_connections4_STRING
MM_connections4_STRING ="Driver={Microsoft Access Driver (*.mdb)};DBQ=sitename/access_db/database.mdb"
%&gt;

The error on site is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x658c Thread 0x23e4 DBC 0x112593c Jet'.
/en/default.asp, line 9
On line 9 I have this code:
Recordset1_cmd.ActiveConnection = MM_connections4_STRING

After contacting to GoDaddy provided the following “example” of how to connect to an Access database: For URL please check help.godaddy.com/article.php?article_id=1039&topic_id,
Which is has to be placed to every asp pages that requesting access database.
&lt;%
Dim oConn, oRs
Dim qry, connectstr, sDSNDir
Dim db_name, db_username, db_userpassword
Dim db_server, dsn_name

dsn_name = "your_dsn_name"
fieldname = "your_fieldname"
tablename = "your_tablename"

sDSNDir = Server.MapPath("_dsn"

connectstr = "filedsn=" & sDSNDir & "\" & dsn_name

Set oConn = Server.CreateObject("ADODB.Connection"
oConn.Open connectstr
qry = "SELECT * FROM " & tablename

Set oRS = oConn.Execute(qry)

if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & " "
oRS.movenext
wend
oRS.close
end if

Set oRs = nothing
Set oConn = nothing

%&gt;


one you create DSN string connection on godaddy.com the name will become same as your access database
database: dataname.mdb
Like: DSN Name: dataname.dsn
Please anyone has the solution for this headache to help me

Thanks in advance….
Baloch


Edited by - balach on 11 Dec 2006 14:40:09


Replied 26 Feb 2007 04:07:50
26 Feb 2007 04:07:50 baloch dashti replied:
It's better host your website somewhere ells, the team support are not friendly, and dont provide you support. i've fixed the problem, but cant update query online and doing it manualy in my pc after uploading the data to server. trying to fix the problems,

OK,

Just follow this it will work on godaddy.com



I use GoDaddy Hosting - If you are having trouble I suggest you delete and re-upload the entire folder and files to your FTP, if you made any edits to the original files.

Remember You HAVE TO USE the fixed connection: GoDaddy does not allow the parent paths.

1. In the GoDaddy "Hosting Manager"(control panel) Go to Databases &gt; Access &gt; Create New DSN

2. Name the DSN "connectionname" (wait a few minutes for it to register - and it will be renamed automatically to "access_connection.dsn" this is correct

3. Copy your Database named "database.mdb" to the "access_db" directory

4. Open up connection folder &gt; connectionname.asp
and change this
(some thing like below connection)

&lt;%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_connRealtor_STRING = "dsn=bestehome;"
%&gt;



to read exactly like this:



&lt;%

' FileName="Connection_ado_conn_string.htm"

' Type="ADO"

' DesigntimeType="ADO"

' HTTP="true"

' Catalog=""

' Schema=""

MM_connectionsname_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/access_db/databasename.mdb" & ";"

%&gt;

So far so good,

1. Create a file named findpath.htm and place it with your ASP pages (not in the Connections folder, it must be with your other ASP pages)

2. Open the findpath.htm in Dreamweaver and type Path to Database on it.

3. Now highlight the text you have just entered and create a link to your database.

4. If you look in the Properties window you may well see something along the lines of ../../connectionname.mdb

5. Use that as your path. Now is that sneaky or is that sneaky??

Upload the connection.asp file and Server.MapPath to godaddy server you should have it all pretty much under control from now on, I forget to tel you that one local server you’ll get error but it’s work on godaddy.



Iqbal Baloch

Edited by - balach on 26 Feb 2007 04:12:58
Replied 07 May 2007 07:35:56
07 May 2007 07:35:56 chan soe replied:
finally I found the solution for this problem.

1. Log into your Godaddy account, click the Hosting Account List link

2. Then you will see an Open link to the right of the domain name that you want to set the folder with permissions up with. Click the Open link.

3. Go to Content, and open Directory Management. Open that folder and click create directory, (name it whatever you want to) I'll use <b>datbase</b> as an example.

4. Then select all of the available permissions except for browse and reset

Then click continue, then click add.

5. Give it about 3 minitues and then look for the folder on your server with your FTP program. Once you see the directory you just created, then download it using your FTP program. Then open your ftdb folder (supplied with your template) and put the yourdatabase.mdb in the directory folder you just downloaded.

6. Now uplaod that folder with the yourdatabase.mdb in it to your server. and change ur connection string like this:

"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/database/yourdatabase.mdb" & ";"

it's work 100%, now you got write access to your database.

cheers and best wishes,
CHAN
www.cmsmdy.com

Edited by - chanmyasoe on 07 May 2007 07:36:55
Replied 13 Aug 2007 18:13:36
13 Aug 2007 18:13:36 George Vargas replied:
[
One clarification;

In the Dreamweaver connections folder open up the connections file and view in code view.

Find the line MM_????_STRING = " blaa blaa" and replace everything after the = with;

"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/database/yourdatabase.mdb" & ";"

Of course yourdatabase.mdb is the name of your .mdb file.

]
finally I found the solution for this problem.

1. Log into your Godaddy account, click the Hosting Account List link

2. Then you will see an Open link to the right of the domain name that you want to set the folder with permissions up with. Click the Open link.

3. Go to Content, and open Directory Management. Open that folder and click create directory, (name it whatever you want to) I'll use <b>datbase</b> as an example.

4. Then select all of the available permissions except for browse and reset

Then click continue, then click add.

5. Give it about 3 minitues and then look for the folder on your server with your FTP program. Once you see the directory you just created, then download it using your FTP program. Then open your ftdb folder (supplied with your template) and put the yourdatabase.mdb in the directory folder you just downloaded.

6. Now uplaod that folder with the yourdatabase.mdb in it to your server. and change ur connection string like this:

"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/database/yourdatabase.mdb" & ";"

it's work 100%, now you got write access to your database.

cheers and best wishes,
CHAN
www.cmsmdy.com

Edited by - chanmyasoe on 07 May 2007 07:36:55


Replied 09 Feb 2008 06:31:47
09 Feb 2008 06:31:47 Richard Keen replied:
I followed the instructions above and here is how my script looks.

Connections folder .asp:

&lt;%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_guardians_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("gotsfwebmaster/database/logon.mdb" & ";"
%&gt;

I did try this as well....
var MM_guardians_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/database/logon.mdb" & ";"

Error recieved:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/logon.asp, line 14


For refrence here is the code on the logon page:
4 // *** Validate request to log in to this site.
5 var MM_LoginAction = Request.ServerVariables("URL";
6 if (Request.QueryString!="" MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
7 var MM_valUsername=String(Request.Form("textfield");
8 if (MM_valUsername != "undefined" {
9 var MM_fldUserAuthorization="";
10 var MM_redirectLoginSuccess="members.asp";
11 var MM_redirectLoginFailed="logon.asp";
12 var MM_flag="ADODB.Recordset";
13 var MM_rsUser = Server.CreateObject(MM_flag);
14 MM_rsUser.ActiveConnection = MM_guardians_STRING;
15 MM_rsUser.Source = "SELECT UID, PWD";
16 if (MM_fldUserAuthorization != "" MM_rsUser.Source += "," + MM_fldUserAuthorization;
17 MM_rsUser.Source += " FROM tblUsers WHERE UID='" + MM_valUsername.replace(/'/g, "''" + "' AND PWD='" + String(Request.Form("textfield2").replace (/'/g, "''" + "'";
18 MM_rsUser.CursorType = 0;
19 MM_rsUser.CursorLocation = 2;
20 MM_rsUser.LockType = 3;
21 MM_rsUser.Open();
22 if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
23 // username and password match - this is a valid user
24 Session("MM_Username" = MM_valUsername;
25 if (MM_fldUserAuthorization != "" {
26 Session("MM_UserAuthorization" = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
27 } else {
28 Session("MM_UserAuthorization" = "";
29 }
30 if (String(Request.QueryString("accessdenied") != "undefined" && false) {
31 MM_redirectLoginSuccess = Request.QueryString("accessdenied";
32 }
33 MM_rsUser.Close();
34 Response.Redirect(MM_redirectLoginSuccess);
35 }
36 MM_rsUser.Close();
37 Response.Redirect(MM_redirectLoginFailed);
38 }
39 %&gt;

Any help would be welcome and I would be gratefull!
Rkeen

Edited by - rkeenjr on 09 Feb 2008 07:05:04

Edited by - rkeenjr on 09 Feb 2008 15:53:22
Replied 09 Mar 2008 12:28:26
09 Mar 2008 12:28:26 emp key replied:
Use OleDB to connect to MS-Access DB files placed anywhere on your hosting space; at root or many lavel sub-folder.
I did it for my website and it works well now.

Edited by - empkeydotcom on 09 Mar 2008 12:28:52

Reply to this topic