Avatar billede realone Nybegynder
28. juni 2001 - 21:35 Der er 8 kommentarer og
1 løsning

Hjælp til fejlmeddelse..

Når jeg prøver at køre mit asp-script, får jeg denne fejlmeddelelse:

Microsoft VBScript compilation error \'800a0415\'

Expected literal constant

/darkside/BoardX/boardx/config.inc, line 15

CONST C_dbConnect = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\"&Server.MapPath(\"data/boardx.mdb\")
----------------------------------------------------------------------------------------------------^


Hvad skal jeg gøre, hvilket tegn(?) mangler..??
Avatar billede realone Nybegynder
28. juni 2001 - 21:45 #1
Resten af koden er her (hvis det hjælper):

<!-- Minus AutoDato -->
<%
\'Configuration for Asp BoardX - Version 1.0 Beta 1
\'created by Mainstream Design
\'http://www.mainstreamdesign.com


\' ----- DATABASE SETUP -----

  \'database settings: modify how the database is accessed

  \'-----------------------------------------------------
  \'CRUCIAL SETTING: get this wrong and nothing will work
  \'-----------------------------------------------------
  CONST C_dbConnect = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\"&Server.MapPath(\"data/boardx.mdb\");

  \'Run GetDBPath.asp in the database directory if you\'re
  \'not sure of the full path to your database file. You
  \'can also use a DSN connection string if you set up a DSN
  \'for the database.

  CONST C_dbPageSize = 10 \'the number of topics to display per page

\' ----- TOPIC POSTING SETUP -----

  \'required fields: specify what fields are required when posting a topic (Yes or No)

  CONST C_Req_Topic = \"Yes\" \'require a Topic name
  CONST C_Req_Name = \"Yes\" \'require a name or alias
  CONST C_Req_Email = \"No\" \'require an email address
  CONST C_Req_Body = \"Yes\" \'require the body of the topic to be completed

\' ----- APPEARANCE -----

  \'--== General Settings ==--

  \'page settings: modify the body tag to edit font bg colour, font colour, etc.

  CONST C_PageTitle = \"Asp BoardX\"
  CONST C_PageBody = \"<body bgcolor=\"\"#FFFFFF\"\" text=\"\"#000000\"\" link=\"\"#006699\"\" vlink=\"\"#999999\"\" alink=\"\"#0099CC\"\">\"
  CONST C_PageTableBG = \"#000000\" \'this is the border colour of the tables
  CONST C_PageLogo = \"<img src=\"\"images/mbLogo.gif\"\">&nbsp;&nbsp;&nbsp;<b><font size=\"\"3\"\">Asp BoardX</font></b>\" \'can be text or an image

  \'font: this will set the font for all elements

  CONST C_PageFont = \"Verdana, Arial, Helvetica, sans-serif\"
  CONST C_PageFontSize = 9 \'pt

  \'links: modify how links are displayed

  CONST C_LinksHover = \"#FF6600\" \'hover colour displays only in IE

  \'--== Specific Settings ==--

  \'read.asp: modify the colours of the headers which contain
  \'          the subject, author name and date posted information

  \'colours for the original post
  CONST C_Read_1 = \"#3366CC\" \'typically a lighter shade of the colour below
  CONST C_Read_2 = \"#000099\"
  CONST C_Read_3 = \"#FFFFFF\" \'text colour

  \'colours for replies
  CONST C_Read_4 = \"#FFFF00\" \'typically a lighter shade of the colour below
  CONST C_Read_5 = \"#FFCC00\"
  CONST C_Read_6 = \"#FFFFFF\" \'text colour
%>
Avatar billede keysersoze Ekspert
28. juni 2001 - 21:46 #2
umiddelbart ingen... men måske er det CONST der er problemet(?)

prøv med noget andet - fx

rs.open = \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath(\"data/boardx.mdb\")
Avatar billede keysersoze Ekspert
28. juni 2001 - 21:50 #3
og dog - det vil kræve ændringer i resten af scriptet (som dog først kom på efter min kommentar) - og det ligner noget du har downloaded et eller andet sted, og så burde det jo virke...

hmm...
Avatar billede realone Nybegynder
28. juni 2001 - 21:52 #4
keysersoze --- Nu er der Intern HTTP-500 Serverfejl.. Filen ovenover er config.inc, som bliver included i default.asp den får du lige her:

<%Option Explicit%>
<!--#include file=\"config.inc\" -->
<!--#include file=\"utilities.inc\" -->

<%
\'declare and set variables

  \'arrays used to display proper sorting method
  \'also sets column widths
  Dim fieldDescriptions, fieldNames, fieldWidths
  fieldDescriptions = Array(\"Topic\", \"Author\", \"Date\", \"Replies\")
  fieldNames = Array(\"topic\", \"author\", \"date_posted\", \"replies\")
  fieldWidths = Array(\"320\", \"145\", \"120\", \"65\")

  Dim curPage, pageCount, topicCount
  Dim sortBy, sortDir, sortDirOpp
  Dim strSearch
  Dim strSQL
  Dim dbRS
  Dim stateQS
  Dim i, x, c

  x = 0

\'get the new current page if available - otherwise set to 1

  curPage = CInt(Request(\"curPage\"))
  If curPage = \"\" Or IsNumeric(curPage) = False Then
    curPage = 1
  Else
    If curPage < 1 Then
    curPage = 1
    End If
  End If

\'get sort settings

  If Request(\"sortBy\") = \"\" Then
    sortBy = Session(\"sortBy\")
  Else
    sortBy = Request(\"sortBy\")
  End If
  If Request(\"sortDir\") = \"\" Then
    sortDir = Session(\"sortDir\")
  Else
    sortDir = Request(\"sortDir\")
  End If

  If sortBy = \"\" Then
    sortBy = \"date_posted\"
  End If
  If sortDir = \"\" Then
    sortDir = \"DESC\"
  End If

  \'get the opposite of the current sort direction in case of change
  If sortDir = \"DESC\" Then
    sortDirOpp = \"ASC\"
  ElseIf sortDir = \"ASC\" Then
    sortDirOpp = \"DESC\"
  End If

\'get the search string and build the SQL statement

  strSearch = Request(\"search\")

  strSQL = \"SELECT ID,parentID,topic,author,date_posted,replies FROM board1 \"
  If Not strSearch = \"\" Then
    strSQL = strSQL & \"WHERE (topic  LIKE \'%\" & web2db(strSearch) & \"%\'  OR\"
    strSQL = strSQL & \"      body  LIKE \'%\" & web2db(strSearch) & \"%\'  OR\"
    strSQL = strSQL & \"      author LIKE \'%\" & web2db(strSearch) & \"%\') \"
  Else
    strSQL = strSQL & \"WHERE parentID = 0 \"
  End If
  strSQL = strSQL & \"ORDER BY \" & sortBy & \" \" & sortDir

\'connect to the database

  Set dbRS = Server.CreateObject(\"ADODB.Recordset\")
  With dbRS
    .CursorLocation = 3
    .CacheSize = C_dbPageSize
    .Open strSQL, C_dbConnect
  End With

  If dbRS.EOF = False Then
    With dbRS
      .MoveFirst
      topicCount = CInt(.RecordCount)
      .PageSize = C_dbPageSize
      pageCount = CInt(.PageCount)
      .AbsolutePage = curPage
    End With
  Else
    topicCount = 0
    pageCount = 1
  End If

\'preconstruct query strings to keep things simple

  stateQS = \"curPage=\" & curPage & \"&\"
  stateQS = stateQS & \"search=\"  & Server.URLEncode(strSearch)
%>



<html>
<head>
<title><%=C_PageTitle%> :: Topics</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<!--#include file=\"javascript.inc\" -->
<!--#include file=\"style.inc\" -->
</head>

<%=C_PageBody%>
<%=C_PageLogo%><br>
<br>
<br>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td><a href=\"java script:NewTopic(0,\'\');\">Add New Topic</a></td>
    <td>&nbsp;&nbsp;|&nbsp;&nbsp;</td>
    <%If Not strSearch = \"\" Then%>
      <td>Search results for <b><%=strSearch%></b> (<a href=\"default.asp\">Show All Topics or New Search</a>)</td>
    <%Else%>
    <form name=\"frmSearch\" method=\"post\" action=\"default.asp\">
      <td>
        <input type=\"text\" name=\"search\" maxlength=\"75\" size=\"15\">
        <input type=\"submit\" name=\"action\" value=\"Search\">
      </td>
    </form>
    <%End If%>
  </tr>
</table>
<br>
<br>
<table width=\"650\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"<%=C_PageTableBG%>\">
  <tr bgcolor=\"#FFFFFF\">
    <%For c = 0 To UBound(fieldNames)%>
      <%If LCase(fieldNames(c)) = sortBy Then%>
      <td width=\"<%=fieldWidths(c)%>\" bgcolor=\"#CCCCCC\">
        <a class=\"fieldName\" href=\"default.asp?sortBy=<%=fieldNames(c)%>&sortDir=<%=sortDirOpp%>&<%=stateQS%>\"><%=fieldDescriptions(c)%><img src=\"images/<%=sortDir%>.gif\" width=\"15\" height=\"7\" border=\"0\"></a>
      </td>
      <%Else%>
      <td width=\"<%=fieldWidths(c)%>\">
        <a class=\"fieldName\" href=\"default.asp?sortBy=<%=fieldNames(c)%>&sortDir=DESC&<%=stateQS%>\"><%=fieldDescriptions(c)%></a>
      </td>
      <%End If%>
    <%Next%>
  </tr>
</table>
<table width=\"650\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">
  <%
  If dbRS.EOF Then
  %>
    <tr>
      <td><i>No Topics Found</i></td>
    </tr>
  <%
  Else
  Do Until dbRS.EOF Or x >= C_dbPageSize
  %>
    <tr>
      <td width=\"<%=fieldWidths(0)%>\" valign=\"top\"><a href=\"read.asp?ID=<%
      If dbRS(\"parentID\") = 0 Then
        Response.Write dbRS(\"ID\")
      Else
        Response.Write dbRS(\"parentID\")
      End If
      %>&<%=stateQS%>\"><%=db2web(dbRS(\"topic\"))%></a></td>
      <td width=\"<%=fieldWidths(1)%>\" valign=\"top\"><%=db2web(dbRS(\"author\"))%></td>
      <td width=\"<%=fieldWidths(2)%>\" valign=\"top\"><%=FormatDateTime(dbRS(\"date_posted\"),2)%></td>
      <td width=\"<%=fieldWidths(3)%>\" valign=\"top\"><%
      If dbRS(\"parentID\") = 0 Then
        Response.Write dbRS(\"replies\")
      Else
        Response.Write \"-\"
      End If
      %></td>
    </tr>
  <%
    x = x + 1
    dbRS.MoveNext
  Loop
  End If
  %>
</table>
<br>
<table width=\"650\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
  <tr>
    <td colspan=\"3\" height=\"1\" bgcolor=\"<%=C_PageTableBG%>\"></td>
  </tr>
  <tr>
    <td width=\"220\" align=\"left\"><font size=\"1\"><a href=\"#top\">top of the page</a></font></td>
    <td width=\"210\" align=\"center\"><b><%=topicCount%></b> Topic(s) Found</td>
    <form name=\"frmPage\">
      <td width=\"220\" align=\"right\"> Page
        <select name=\"page\" onChange=\"goPage(this);\">
          <%For i = 1 To pageCount%>
          <option value=<%=i%><%If i=curPage Then Response.Write(\" selected\")%>><%=i%></option>
          <%Next%>
        </select>
        of <%=pageCount%></td>
    </form>
  </tr>
</table>
<br>
<table width=\"650\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">
  <tr>
    <!-- Please do not remove this link //-->
    <td align=\"right\"><font size=\"1\">Asp BoardX Created by <a href=\"http://www.mainstreamdesign.com\">Mainstream Design</a></font></td>
  </tr>
</table>
</body>
</html>

<%
\'clear recordset from memory

  Set dbRS = Nothing

\'store sort settings in session variables

  Session(\"sortBy\") = sortBy
  Session(\"sortDir\") = sortDir
%>


----------------------
Hvis du (eller en anden) finder fejlen og får scriptet til at køre, er der udlovet 60 point..
</RealOne>
Avatar billede realone Nybegynder
28. juni 2001 - 21:54 #5
Keysersoze --- Du har helt ret.. Det er downloadet, det gør med alle mine scripts, downloader dem, retter dem til og kigger på hvordan de er bygget op.. Sådan lærer jeg..
</RealOne> 
Avatar billede realone Nybegynder
28. juni 2001 - 22:01 #6
Glem det.. Fejlen er fundet..
Avatar billede keysersoze Ekspert
28. juni 2001 - 22:03 #7
ja - man må jo gå ud fra, at et script der bliver lagt til upload virker... jeg har ikke lige noget forslag ellers
Avatar billede realone Nybegynder
28. juni 2001 - 22:04 #8
keysersoze --- Tjaa, man må jo efterhånden lære at læse den readme-fil der er med..  ;o)
Der står som regel noget godt i..
Avatar billede cort Nybegynder
29. juni 2001 - 08:46 #9
God ide er at søge på msdn.microsoft.com

skriv din fejl meddelese i søge feltet:

Microsoft VBScript compilation error \'800a0415\'
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester