Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone check small code - see why it doesn't work?

Status
Not open for further replies.

slakker

MIS
Jun 5, 2003
59
US
Hey guys.. I'm trying to make a very small TEST site with DW MX 2004, the point-and-click way.. without manually writing any code (not that i'm good at it anyway)

But I can't get it to work, i've tried to create and recreate sites, keep changing little things, but still nothing..

===========================================================

<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<!--#include file=&quot;Connections/db.asp&quot; -->
<%
Dim rsRecentNews
Dim rsRecentNews_numRows

Set rsRecentNews = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsRecentNews.ActiveConnection = MM_db_STRING
rsRecentNews.Source = &quot;SELECT * FROM Table1 ORDER BY newsDate DESC&quot;
rsRecentNews.CursorType = 0
rsRecentNews.CursorLocation = 2
rsRecentNews.LockType = 1
rsRecentNews.Open()

rsRecentNews_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsRecentNews_numRows = rsRecentNews_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>
<p>My Homepage</p>
<p>Recently, I've added a number of things to my site:</p>
<p><%=(rsRecentNews.Fields.Item(&quot;newsDate&quot;).Value)%></p>
<p><%=(rsRecentNews.Fields.Item(&quot;newsText&quot;).Value)%></p>
</body>
</html>
<%
rsRecentNews.Close()
Set rsRecentNews = Nothing
%>
==========================================================

----------------- My Connection file --------------------

<%
' FileName=&quot;default_oledb.htm&quot;
' Type=&quot;ADO&quot;
' DesigntimeType=&quot;ADO&quot;
' HTTP=&quot;false&quot;
' Catalog=&quot;&quot;
' Schema=&quot;&quot;
Dim MM_db_STRING
MM_db_STRING = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\folder\test\news.mdb;Persist Security Info=False&quot;
%>
----------------- My Connection file --------------------

I upload the index.asp in the Root
news.mdb into the Root
and /Connections/db.asp

I try to access via the internet, I get http 500 internal error.

I don't understand how the connections file is supposed to locate my database when i'm trying site on the internet, when it thinks the location is c:\folder\etc..

But I did try changing that to just local path.
 
different ways to connect to your DB...on your Loacl machine it will work but not on the &quot;internet&quot;-production server.
u need to use 2 connection strings...1 at home the other for the server.
use DSN-less and 'map the path' to the db location on the server

MM_MY_STRING = &quot;Provider=Microsoft.Jet.OLEDB.4.0; Persist Security Info=False; Data Source=&quot; & Server.MapPath(&quot;/fpdb/MY_DATABASE.mdb&quot;) & &quot;;

notice that folder 'FPDB' can be anywhere as long as the server has is recognised as part of the site.Actuall phisycal loaciton can be C:\websites\users\user_z\ but the &quot;Map.Path&quot; command tells the server to &quot;not worry&quot; about the structure but simply point to 1 folder (which should have appropriate rights) where the DB is loacted......
take a look at :

sorry if the post is confusing...I am in a bit of rush but these concepts should get u going
ALl the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top