webForumDet fria alternativet

Hittar inget fel.

ASP

3 svar · 437 visningar · startad av cgi

Medlem sedan jan. 2000371 inlägg
Frågan#1

Hittar inget fel i index.asp filen. http://reptiler.webhostme.com/forum/forum/index.asp
Så här ser koden ut:

<%

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open Session("dbasepath")

SQLStmt = "SELECT * FROM Forums"
Set RS = Connection.Execute(SQLStmt)

%>
<html>

<head>
<link REL="stylesheet" HREF="styles/forum.css" TYPE="text/css">
<title>Forum.</title>
<meta name="Author" content="Mikael Östberg">
<meta name="Company" content="Intermedia Publishing AB">
<meta name="Publishied" content="1999">
<meta name="Copyright" content="Intermedia Publishing AB">
</head>

<body MARGINHEIGHT="0" MARGINWIDTH="0" bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" vlink="#0000FF">

<table border="0" width="600">
<tr>
<td width="188" valign="top" colspan="2"><img src="images/forumlogga.gif" alt="forumlogga.gif (3211 bytes)" WIDTH="265" HEIGHT="108"></td>
</tr>
<tr>
<td width="200" valign="top"><p align="right"><img src="images/dottedvertical.gif" WIDTH="2" HEIGHT="361"></td>
<td valign="top" width="608"><p align="left"><font face="Verdana" size="2">Hej! </font><font color="#808080" face="Verdana" size="2">Välkommen till vårt fina forum där vi
diskuterar ASP och allting runt omkring. Har du några frågor kan du ställa dem här
alternativt använda vår nyhetsgrupp: <a href="news://news.infomaster.net">news.infomaster.net</a></font></p>
<table border="0" width="101%">
<tr>
<td width="55%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Forum</font></small></strong></td>
<td width="16%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Inlägg</font></small></strong></td>
<td width="26%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Senaste inlägg</font></small></strong></td>
</tr>
<% Do until RS.EOF

SQLStmt = "SELECT *, Format$([date],'yyyy/mm/dd') AS FormDate, Format$([date],'hh:mm') AS FormTime FROM Entries Where ForumId =" & RS("Id")
SQLStmt = SQLStmt & " order by Id desc"
Set RS2 = Connection.Execute(SQLStmt)

SQLStmt = "SELECT Count(*) AS ItemCount FROM Entries Where ForumId =" & RS("Id")
Set RS3 = Connection.Execute(SQLStmt)

%>
<tr>
<td width="55%" bgcolor="#F7F7F7"><b><small><font face="Verdana"><a href="forumthreads.asp?forumid=<%=RS("Id")%>"><%=RS("Forum")%></a><br>
<small><% ' = RS("Description")%> </small></font></small></b></td>
<td width="16%" bgcolor="#D4D4D4" valign="top" align="left"><small><font face="Verdana"><%= RS3("ItemCount") %></font></small></td>
<td width="26%" bgcolor="#F7F7F7" valign="top" align="left"><small><font face="Verdana"><%=RS2("FormDate")%></font></small></td>
</tr>
<%
RS.MoveNext

Loop
RS.Close
RS2.Close
RS3.Close

%>
</table>
<p align="left"><img src="images/dottedline.gif" alt="dottedline.gif (109 bytes)" WIDTH="360" HEIGHT="2"></p>
<table border="0" width="100%">
<tr>
<td width="50%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Sök bland
inläggen:</font></small></strong></td>
</tr>
<tr>
<td width="50%"><form method="POST" action="forumsearch.asp">
<p><input type="text" name="keyword" size="20" tabindex="1"> <input src="images/search.gif" name="I1" type="image" WIDTH="100" HEIGHT="20"></p>
</form>
</td>
</tr>
</table>
<p> </td>
</tr>
</table>

<p> </p>
</body>
</html>
<% Connection.Close %>

Medlem sedan dec. 199919 074 inlägg
#2

Det finns ingen sökväg till din databas alls där... Kolla hur det ser ut i koden till min gästbok:
Session("ConnGuestBook_ConnectionString") = "DBQ=" & Server.Mappath("\cgi-bin\guestbook.mdb") & ";DefaultDir=" & Server.Mappath("\cgi-bin\guestbook.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS

Nått sånt måste du ha med annars får du inte till det alls.... (Tror jag... ;) ;) ;))

------------------
// BIRE
http://bire.cjb.net
bire@telia.com

Medlem sedan jan. 2000371 inlägg
#3

Till bire.
Skulle du kunna kopiera dina filer till din gästbok och maila över dom till mig.
More väldigt tacksam för det.
Så får vi se om jag får i gång gästboken iallafall.Forumet verkar helt hopplöst att få igång.
Tack på förhand.

Har ialla fall ändrat lite i koden men det går fortfarande inte igång, kan du se någor fel.

<%

Session("ConnGuestBook_ConnectionString") = "DBQ=" & Server.Mappath("\cgi-bin\forum.mdb") & ";DefaultDir=" & Server.Mappath("\cgi-bin\forum.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open Session("dbasepath")

SQLStmt = "SELECT * FROM Forums"
Set RS = Connection.Execute(SQLStmt)

%>
<html>

<head>
<link REL="stylesheet" HREF="styles/forum.css" TYPE="text/css">
<title>Forum.</title>
<meta name="Author" content="Michael Jenselius">
<meta name="Company" content="Intermedia Publishing AB">
<meta name="Publishied" content="1998">
<meta name="Copyright" content="Intermedia Publishing AB">
</head>

<body MARGINHEIGHT="0" MARGINWIDTH="0" bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" vlink="#0000FF">

<table border="0" width="600">
<tr>
<td width="188" valign="top" colspan="2"><img src="images/forumlogga.gif" alt="forumlogga.gif (3211 bytes)" WIDTH="265" HEIGHT="108"></td>
</tr>
<tr>
<td width="200" valign="top"><p align="right"><img src="images/dottedvertical.gif" WIDTH="2" HEIGHT="361"></td>
<td valign="top" width="608"><p align="left"><font face="Verdana" size="2">Hej! </font><font color="#808080" face="Verdana" size="2">Välkommen till vårt fina forum där vi
diskuterar ASP och allting runt omkring. Har du några frågor kan du ställa dem här
alternativt använda vår nyhetsgrupp: <a href="news://news.infomaster.net">news.infomaster.net</a></font></p>
<table border="0" width="101%">
<tr>
<td width="55%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Forum</font></small></strong></td>
<td width="16%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Inlägg</font></small></strong></td>
<td width="26%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Senaste inlägg</font></small></strong></td>
</tr>
<% Do until RS.EOF

SQLStmt = "SELECT *, Format$([date],'yyyy/mm/dd') AS FormDate, Format$([date],'hh:mm') AS FormTime FROM Entries Where ForumId =" & RS("Id")
SQLStmt = SQLStmt & " order by Id desc"
Set RS2 = Connection.Execute(SQLStmt)

SQLStmt = "SELECT Count(*) AS ItemCount FROM Entries Where ForumId =" & RS("Id")
Set RS3 = Connection.Execute(SQLStmt)

%>
<tr>
<td width="55%" bgcolor="#F7F7F7"><b><small><font face="Verdana"><a href="forumthreads.asp?forumid=<%=RS("Id")%>"><%=RS("Forum")%></a><br>
<small><% ' = RS("Description")%> </small></font></small></b></td>
<td width="16%" bgcolor="#D4D4D4" valign="top" align="left"><small><font face="Verdana"><%= RS3("ItemCount") %></font></small></td>
<td width="26%" bgcolor="#F7F7F7" valign="top" align="left"><small><font face="Verdana"><%=RS2("FormDate")%></font></small></td>
</tr>
<%
RS.MoveNext

Loop
RS.Close
RS2.Close
RS3.Close

%>
</table>
<p align="left"><img src="images/dottedline.gif" alt="dottedline.gif (109 bytes)" WIDTH="360" HEIGHT="2"></p>
<table border="0" width="100%">
<tr>
<td width="50%" bgcolor="#B3D9D9"><strong><small><font face="Verdana">Sök bland
inläggen:</font></small></strong></td>
</tr>
<tr>
<td width="50%"><form method="POST" action="forumsearch.asp">
<p><input type="text" name="keyword" size="20" tabindex="1"> <input src="images/search.gif" name="I1" type="image" WIDTH="100" HEIGHT="20"></p>
</form>
</td>
</tr>
</table>
<p> </td>
</tr>
</table>

<p> </p>
</body>
</html>
<% Connection.Close %>

Medlem sedan dec. 199919 074 inlägg
#4

Tjena CGI !

Jag är bara en nybörjare på ASP men om du klistrar in följande istället för din sökväg så borde det funka...

<%
Session("dbasepath") = "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("\cgi-bin\guestbook.mdb")

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open Session("dbasepath")

SQLStmt = "SELECT * FROM Forums"
Set RS = Connection.Execute(SQLStmt)

%>

Funkar det inte så hoppas jag att jag blir rättad av de mer erfarna programerarna som hjälpt mig här i forumet !!! ;)

Jag vill ogärna maila mina filer till min gästbok då de ev kan innehålla fel som jag inte har upptäckt ännu samt att den gästboken är modifierad på ett sätt som bara jag förstår (Läs förstOG...) ;)

Sen vill man ju ha lite hemlisar... ;) ;) ;)

Kolla gärna min gästbok om du vill: http://bire.webhostme.com/guestbook/

------------------
// BIRE
http://bire.cjb.net
bire@telia.com

267 ms totalt · 4 externa anrop · v20260731065814-full.6fe65c25
125 ms — deklarationer (db)
0 ms — hämta statistik (cache)
134 ms — hämta tråd, inlägg och bilagor (db)
129 ms — ändringar (db)