Link to home
Start Free TrialLog in
Avatar of knoxDerek
knoxDerek

asked on

Connecting to Access database in Dreamweaver using GoDaddy

I use Dreamweaver CS3. I have an Access database. I have a GoDaddy shared hoting account. I have set up a DSN through GoDaddy. I have tried to use their code for connecting to an ACCESS database. This can be forund here:  http://help.godaddy.com/article/257

my DSN created throgh GoDaddy is named: access_composeyours.dsn
- the DSN has a username and password assigned

the connection file in dreamweaver is named: access_composeyours.asp (I figured I was suppose to name it the same as my DSN??)

the microsoft access database name is: composeyours.mdb
- this database is located inside the "access_db" folder on GoDaddy


I'm not a programmer, and therefore I am unsure what or where to change out their words in this code for my information. I have attempted to the best of my knowledge, and I can view the database information on my local machine within Dreamweaver. So, I can create a recordset,etc. But, when I try to view just a simple asp page I created a recordset on using the connection, I get the following error msg in my browser:

Microsoft JScript compilation error '800a03ec'

Expected ';'

/Connections/access_composeyours.asp, line 2

Dim oConn, oRs
----^

Now, just to try and give you as much info as possibe:

I have set up my testing server to be the same as my remote host (my website at GoDaddy) and I have the server model set to "ASPJAVASCRIPT".

I have researched all over the web and found examples of DSN-Less connection scripts, etc and I have managed to get the same result of being able to see the information locally (like it makes the connection) but fails when I try to load a page using a recordset referencing the DSN.
here is my dsn connection file code tring to use GoDaddy's example:
 
<%
Dim oConn, oRs
Dim qry, connectstr
Dim db_path
Dim db_dir
db_dir = Server.MapPath("access_db") &amp; "\"
db_path = db_dir &amp; "composeyours.mdb"
fieldname = "firstname"
tablename = "Customers"
 
connectstr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &amp; db_path
 
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " &amp; tablename
 
Set oRS = oConn.Execute(qry)
 
if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) &amp; ": " &amp; oRs.Fields(fieldname) &amp; "
"
oRS.movenext
wend
oRS.close
end if
 
Set oRs = nothing
Set oConn = nothing
 
%>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of knoxDerek
knoxDerek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeffrey Coachman
Great, Congratulations!
;-)

I was going to suggest that you call GoDaddy directly.
They have great support.

The good news is that here, you can actually accept your own post as the solution!
;-)

JeffCoachman