PDA

View Full Version : connecting to Access database using DNS


Michael W
07-30-2008, 08:46 AM
I am trying to connect to a database i created in access. I am using Dreamweaver CS3 FTP to connect to discountasp .
I have named the:
DNS healthyeate_connect
Path \_database\customerDetails.mdb
When in dreamwaever and I am trying to make a connection using the DSN connecting box i input the DNS - healthyeate_connect, then i click on the DNS button to select the ODBC but the list is blank.
What am i doing wrong or what am i meant to do?
I have uploading the database to the correct folder and my document type is ASP VB script.

wisemx
07-30-2008, 09:31 AM
Hi,
I used Macromedia Studio for years for Access, SQL Server and ASP, loved it.</o:p>
Haven't used the newer CS3 but I'm guessing the methods are the same.</o:p>
</o:p>
Let me ask a few questions...</o:p>
</o:p>
Are you on IIS6 or IIS7 here?</o:p>
</o:p>
Does this need to be with a DSN? Will aDSN-less connectionwork for you?
I always found them much easier to work with.</o:p>
</o:p>
btw, did you create the DSN in your Control Panel and on your local machine?</o:p>
If so, do you have any files that Dreamweaver created? typically they are named such as conn.*</o:p>
</o:p>
I'll do my best to get you up and running.
Salute,
Mark</o:p>

Michael W
07-31-2008, 05:57 AM
Am on ASP.NET 3.5 hosting
Sorry for lack of info, am a real noob when it comes to database connection but i do know about it and have SQL knowledge. I hope i don?t become a nuisance here lol.
*Right, i believe am on the IIS7. (but no option for me in control panel regarding IIS)
* The connection does not have to be in DNS as long as i can connect and interact with the database. There is option on the CS3 for DNS less connection so am sure it works for me.
*I did create the DNS in the control panel on discount ASP.net

DNS healthyeate_connect
Path \_database\customerDetails.mdb</o:p>
But not on the local host machine. (why on local host)</o:p>
*i have connecting to the root of my site and all other folders (remote file) on the hosting site.</o:p>

wisemx
07-31-2008, 06:45 AM
Hi,
In your Control Panel it will show, under the Info section, if you are on Windows Server 2003 or 2008.
If it shows 2008 you are under IIS7.


The reason I asked is apparently some of the Access DB methods are not available on IIS7.
I haven't had time to test Access on IIS7 yet but this DNS-less method should work:
http://kb.discountasp.net/article.aspx?id=10476


btw, The reason I asked if you had created a local DSN is the way Dreamweaver allows testing.
It has a very nice feature where you can have your data servers, local and remote connecitons, etc.
Can alsowritehundreds of lines of code for you once you create those connfiles.
Salute,
Mark

Michael W
07-31-2008, 07:26 AM
ok, thanks for that. i checked and it is:


Windows 2003 - IIS 6.0


no local DNS was made.

wisemx
07-31-2008, 07:52 AM
I never had any problems running ASP and Access code on the 2003 servers here.
You should be all set once you learn more about the IDE you are using.
Actually I really miss the site sync features in Dreamweaver.
It's my active wish that Visual Studio someday will have similar features. http://community.discountasp.net/emoticons/wink.gif
Salute,
Mark

Michael W
07-31-2008, 07:58 AM
here can can i to learn a step to step on how to connect http://community.discountasp.net/emoticons/cool.gif .


or can u talk me through it if u have time.


Michael

wisemx
07-31-2008, 08:33 AM
I'll install my Macromedia Studio 2004 MX on the system I use for my kids.
Will be later today if they, my three kids, give me some time. http://community.discountasp.net/emoticons/wink.gif
Then I'll be able to give you step-by-steps.

Macromedia used to have good instructions on thier site.
Since the Adobe buyout I didn't access their site anymore but you may want to take a look.
There should be some good stuff there for your product and Access connections.
Salute,
Mark

Michael W
07-31-2008, 10:01 AM
man ur really help full, thanks alot for taking the time out. I am also looking at


http://www.expertrating.com/courseware/DreamweaverCourse/Dreamweaver-Tutorial.asp


for help. ill be on there till 1am then carry on tomorrow. hopfully will get this database up and running.





----------------------------------------------------------------
Michael


Michael

wisemx
07-31-2008, 10:31 AM
They have some annoying popups on that site but this page is a good one for you:
http://www.expertrating.com/courseware/DreamweaverCourse/Dreamweaver-Database-7-2.asp

wisemx
08-01-2008, 12:46 AM
UPDATE...

What I decided to do is create an example site for you using Dreamweaver and an Access DB named the same as yours.
I've also used the same folder location for it, "_database" .

In Dreamweaver the best thing for your account here will be to have two connection strings.
One for local testing and development, the other for the live site.
From the Dynamic section of the toolbar you can connect to any connection strings you place in the /connections/ folder.

For the example site attached I've created one for your local testing and one for the remote site.
(Listed below)

The conn string for local testing uses a physical location for the database. (Local drive)
Forthe live,remote, site I'm using the Server.MapPath method. (Very handy)

Local: (/Connections/conn.asp)

[quote]

<%
Dim MM_conn_STRING
MM_conn_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\sdknuts0\_database\customerDetails .mdb"
%></CODE>
Remote: (/Connections/Conn2.asp)

[quote]

<%
Dim MM_Conn2_STRING
MM_Conn2_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &amp; Server.MapPath("/_database/customerDetails.mdb") &amp; ";"
%></CODE>
In the first conn string, Local, my local site folder is c:\sdknuts0\.
That can be any physical location you prefer in Dreamweaver.

This is the code for the recordset I created from Dreamweaver using the Dynamic toolbar features:
[quote]

<%@LANGUAGE="VBSCRIPT ('%@LANGUAGE="VBSCRIPT')" CODEPAGE="1252"%>
<!--#include file="Connections/conn2.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_Conn2_STRING
Recordset1.Source = "SELECT * FROM tblPages"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ADO RecordSet</title>
</head>
[b]
<div>
<table align="center" border="0" cellpadding="4" cellspacing="4">
<tr><td align="left"><u>Customer</u>:</td><td align="left"><u>Details</u>:</td></tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<%="<tr><td align=""left"">&amp;#8226; " &amp; (Recordset1.Fields.Item("Customer").Value) &amp; "</td><td align=""left"">" &amp; (Recordset1.Fields.Item("Details").Value) &amp; "</td></tr>"%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
</div>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
</CODE>
And this is the example page using all of that code, the remote conn string listed above and the same Access Database:
http://sdknutsnet0.web148.discountasp.net/rs.asp

Using Dreamweaver it took about 10 minutes to create the conn string and all of the code...
Because the dynamic features do most of the code/work for you.
The sample site is attached, code and database.
Hope this helps,
Mark Wisecarver aka wisemx



Post Edited (wisemx) : 8/2/2008 8:21:09 PM GMT

Michael W
08-03-2008, 06:23 AM
thanks alot wisemx





i will have a look at this and a go at it monday. am on my way to work in a few hours.


fingers crossed. have a good day. http://community.discountasp.net/emoticons/smilewinkgrin.gif

Michael

Michael W
08-03-2008, 06:23 AM
wooops wrong post icon lol,

Michael

mother
11-01-2008, 07:45 AM
Thanks to this tread I am now connected to DSP VIA Dreamweaver remote. Custom connection string I used:


"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &amp; Server.MapPath("/_database/educoncert.mdb")


I feel my headache going away.http://community.discountasp.net/emoticons/jumpin.gif

wisemx
11-01-2008, 08:18 AM
Good job http://community.discountasp.net/emoticons/yeah.gif


Technical Evangelist for DiscountASP.NET
http://www.iis7test.com/webcasts/
http://weblogs.asp.net/markwisecarver/
http://blogs.windowsclient.net/wisecarver/default.aspx

(Microsoft IT Usability http://msitusability.multiply.com/)