HighDots Forums  

Ideal MDB location ?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Ideal MDB location ? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
VegaLA
 
Posts: n/a

Default Ideal MDB location ? - 07-07-2004 , 02:19 PM






Hi guys,
can someone please suggest the best place to store an mdb database file that
will contain data for a website. Is it best to have it in the same folder as
the html files or can it be stored in a seperate folder elsewhere or maybe on a
different server? I would like to find a good home for it before setting up
the ODBC configuration.


Reply With Quote
  #2  
Old   
darrel
 
Posts: n/a

Default Re: Ideal MDB location ? - 07-07-2004 , 02:32 PM






Quote:
can someone please suggest the best place to store an mdb database file
that
will contain data for a website. Is it best to have it in the same folder
as
the html files or can it be stored in a seperate folder elsewhere or maybe
on a
different server? I would like to find a good home for it before setting
up
the ODBC configuration.
Ideally, it'd be located outside of the web directory. It just adds one
slight layer of additional security.

-Darrel




Reply With Quote
  #3  
Old   
Durwood Edwards
 
Posts: n/a

Default Re: Ideal MDB location ? - 07-07-2004 , 02:49 PM



I place mine in a database directory that I placed one level above my web's
root directory.
"VegaLA" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Hi guys,
can someone please suggest the best place to store an mdb database file
that
will contain data for a website. Is it best to have it in the same folder
as
the html files or can it be stored in a seperate folder elsewhere or maybe
on a
different server? I would like to find a good home for it before setting
up
the ODBC configuration.




Reply With Quote
  #4  
Old   
VegaLA
 
Posts: n/a

Default Re: Ideal MDB location ? - 07-07-2004 , 04:01 PM



OK thanks guys.
I'm just playing with web based DB at the moment. I am having probs however
with this code...

<%
'The first line declares the variables

Dim dblocat, cnn, cnnstring, rs, SQL

'The location of our database is stored in the variable called dblocat
'Change it to the location of your database on the server.
dblocat = "\data\intranet.mdb"

'These 2 lines tell the server how to connect to the database.
'cnn is used to store the 'connection object', ie how to connect to the
database
'cnnstring stores the method in which the database is connected to, and takes
'dblocat (above) as the location for the database.

set cnn = server.CreateObject("ADODB.Connection")
cnnstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & dblocat

'Now we've told it how to connect, this says to the server "Go Connect!"

cnn.open(cnnstring)

'Right, we're doing well. The database is open, ready and waiting. Now, let's
'get some data out of it. These 2 lines create a 'recordset', basically letting
'you read the database.

Set rs = server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = cnn

'Now we can query the database. The following line will do this:

SQL= "SELECT * From departmental"

'The stament above should be written in the format: 'SELECT * From tablename'
'Where 'tablename' is the name of the table you created earlier in the
database.

rs.Open SQL

'Now, print the results on the screen. The HTML Tags, below, will put the data
into a simple table.

rs.MoveFirst
%>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="80%">
<tr> <td><b>Title</b></td> <td><b>Author</b></td> <td><b>Date</b></td> </tr>
<tr><td></td><td></td><td></td></tr>
<%
while not rs.EOF ' Keep going until all of the records have been displayed.
%>
<tr><td><%=rs("Title")%></td> <td><%=rs("Author")%></td>
<td><%=rs("Date")%></td>
<%
'Now, move to the next record & start again.
rs.MoveNext
wend
%>

When I look at it on the website I get this error message....

Microsoft JET Database Engine error '80004005'

'c:\data\intranet.mdb' is not a valid path. Make sure that the path name is
spelled correctly and that you are connected to the server on which the file
resides.

/lesson1.asp, line 20

Mitch...


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.