Rlane313
Posts: 7
|
| Posted: 10/29/2007, 7:16 AM |
|
I am trying to get my site to connect to the database on the remote server. Below is an example of what the hosting service has for help in connecting to my Access database. I don't know how to set up the remote server data connection in CodeCharge 2.3.2.28. The project is configured as ASP 3.0 with Templates. Further below is what the control panel shows for connection information.
Can someone please help me configure my DSN to work? I am just using the normal database connection windows in CodeCharge.
***********************************************************************************************
This example describes using File DSN and ASP/ADO to connect to an 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
%>
*********************************************************************************
Here is what the control panel has for File DSN configuration:
DSN Information
DSN Name: access_guestinput.dsn
Database File Information:
File Name: guestinput.mdb
DSN Type Information
DSN Type: File DSN
Connection Information
Enter User Name: admin
Enter Password:
|
 |
 |
Rlane313
Posts: 7
|
| Posted: 10/31/2007, 8:53 AM |
|
Well I haven't had any help on this so I figured it out for myself.
Here is what worked for me. GoDaddy isn't very helpful in working with your code. They just send you to documentation that gives examples. That doesn't help when you are coding in CodeCharge and are a dummy like me that doesn't want to alter code directly.
They suggested a small test asp page with this code:
<%
Dim thepath
thepath = Server.MapPath("")
response.write thepath
%
Just creat an asp page with this code in it and add the folder name inside the quotation marks that you need the full path to. Then save it and upload it to the remote server and access the page on the site. It will show you the full path which then can be pasted into the database connection screen. I just used the build your connection in the server side of the database connection properties and selected MS Jet 4.0 OLE DB Provider, click Next and pasted the full path plus the database name in the first box. That was it. The site worked fine.
GoDaddy automatically created a folder just for database files with the proper permissions.
Happy coding!!
|
 |
 |
|