Avatar billede starf Nybegynder
16. april 2001 - 16:24 Der er 13 kommentarer og
1 løsning

Problem med script..

Hej.. Når jeg køre følgende script på min iis server så virker det fint.. men hvis det køre på en anden server, (der hvor min hp bliver hosted) så får jeg følgende fejl..

\"Response object error \'ASP 0156 : 80004005\'

Header Error

/show.asp, line 6

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. \"


Mit script er:

<!--#include file=\"common.asp\" -->
<html>
<head>
<title>Galleri</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"arf.css\">
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<%
Response.Buffer = True
%>
<%
NumSeconds = Request(\"Time\")
thisFolder = Request(\"Folder\")
Index = CInt(Request(\"Index\"))
myTextPath = myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile
Set objNextLink = Server.CreateObject(\"MSWC.NextLink\")
TotalItems = objNextLink.GetListCount(myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile)
%>

<%
If NumSeconds <> \"None\" Then
    If Index = TotalItems Then
        Response.Write(\"<META HTTP-EQUIV=\"\"Refresh\"\" CONTENT=\"\"\" & NumSeconds & \";URL=list.asp?Folder=\" & thisFolder & \"\"\">\")
    Else
        Response.Write(\"<META HTTP-EQUIV=\"\"Refresh\"\" CONTENT=\"\"\" & NumSeconds _
            & \";URL=show.asp?Index=\" & Index + 1 & \"&Folder=\" _
            & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\")
    End If
End If
%>
<body bgcolor=\"#ffffff\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
  <tr bgcolor=\"#5D7484\">
    <td align=\"left\" valign=\"top\"> <%
If Index > 1 Then
    Response.Write(\"<a href=\"\"show.asp?Index=\" & Index - 1 & \"&Folder=\" _
        & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\" & \"Sidste Billede</a>\")
Else
    Response.Write(\" \")
End If
%> </td>
    <td align=\"center\" valign=\"top\"><a href=\"list.asp?Folder=<%=thisFolder%>\">Indhold</a>
      <%
Response.Write(\" [\" & Index & \"/\" & TotalItems & \"]\")
%> </td>
    <td align=\"right\" valign=\"top\"> <%
If Index >= 1 Then
    If Index < TotalItems Then
        Response.Write(\"<a href=\"\"show.asp?Index=\" & Index + 1 & \"&Folder=\" _
            & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\" & \"Næste Billede</a>\")
    Else
        Response.Write(\" \")
    End If
Else
    Response.Write(\" \")
End If
%> </td>
  </tr>
</table>
<br>
<div align=\"center\">
<%
picWholeDescription = objNextLink.GetNthDescription(myTextPath, Index)
If InStr(picWholeDescription, mySeparator) Then
    picPositionSeparator = InStr(1, picWholeDescription, mySeparator)
    picTitle = Left(picWholeDescription, picPositionSeparator - 1)
    picDescription = Mid(picWholeDescription, picPositionSeparator + 5)
Else
    picTitle = picWholeDescription
    picDescription = \"\"
End If

Response.Write(\"<span style=\"\"color: #330099; font-weight: bold; font-family: Arial, Helvetica\"\">\" _
  & picTitle & \"</span><br><br>\" _
  & \"<img src=\"\"\" & myFolder & \"\\\" & thisFolder & \"\\\" _
  & objNextLink.GetNthURL(myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile, Index) _
  & \"\"\" border=\"\"1\"\"><br><br>\" & picDescription)
Set objNextLink = Nothing
%>
</div>
Avatar billede keysersoze Ekspert
16. april 2001 - 16:27 #1
response.buffer = true

skal sættes i toppen!
Avatar billede keysersoze Ekspert
16. april 2001 - 16:28 #2
= HELT i toppen
Avatar billede starf Nybegynder
16. april 2001 - 16:30 #3
er gjort nu.. men det giver stadig denne her fejl
Response object error \'ASP 0156 : 80004005\'

Header Error

/show.asp, line 6

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
Avatar billede bjarke-b Nybegynder
16. april 2001 - 16:48 #4
<%
Response.Buffer = True
%>
<!--#include file=\"common.asp\" -->
<html>
<head>
<title>Galleri</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"arf.css\">
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<%
NumSeconds = Request(\"Time\")
thisFolder = Request(\"Folder\")
Index = CInt(Request(\"Index\"))
myTextPath = myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile
Set objNextLink = Server.CreateObject(\"MSWC.NextLink\")
TotalItems = objNextLink.GetListCount(myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile)
%>

<%
If NumSeconds <> \"None\" Then
    If Index = TotalItems Then
        Response.Write(\"<META HTTP-EQUIV=\"\"Refresh\"\" CONTENT=\"\"\" & NumSeconds & \";URL=list.asp?Folder=\" & thisFolder & \"\"\">\")
    Else
        Response.Write(\"<META HTTP-EQUIV=\"\"Refresh\"\" CONTENT=\"\"\" & NumSeconds _
            & \";URL=show.asp?Index=\" & Index + 1 & \"&Folder=\" _
            & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\")
    End If
End If
%>
<body bgcolor=\"#ffffff\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
  <tr bgcolor=\"#5D7484\">
    <td align=\"left\" valign=\"top\"> <%
If Index > 1 Then
    Response.Write(\"<a href=\"\"show.asp?Index=\" & Index - 1 & \"&Folder=\" _
        & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\" & \"Sidste Billede</a>\")
Else
    Response.Write(\" \")
End If
%> </td>
    <td align=\"center\" valign=\"top\"><a href=\"list.asp?Folder=<%=thisFolder%>\">Indhold</a>
      <%
Response.Write(\" [\" & Index & \"/\" & TotalItems & \"]\")
%> </td>
    <td align=\"right\" valign=\"top\"> <%
If Index >= 1 Then
    If Index < TotalItems Then
        Response.Write(\"<a href=\"\"show.asp?Index=\" & Index + 1 & \"&Folder=\" _
            & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\" & \"Næste Billede</a>\")
    Else
        Response.Write(\" \")
    End If
Else
    Response.Write(\" \")
End If
%> </td>
  </tr>
</table>
<br>
<div align=\"center\">
<%
picWholeDescription = objNextLink.GetNthDescription(myTextPath, Index)
If InStr(picWholeDescription, mySeparator) Then
    picPositionSeparator = InStr(1, picWholeDescription, mySeparator)
    picTitle = Left(picWholeDescription, picPositionSeparator - 1)
    picDescription = Mid(picWholeDescription, picPositionSeparator + 5)
Else
    picTitle = picWholeDescription
    picDescription = \"\"
End If

Response.Write(\"<span style=\"\"color: #330099; font-weight: bold; font-family: Arial, Helvetica\"\">\" _
  & picTitle & \"</span><br><br>\" _
  & \"<img src=\"\"\" & myFolder & \"\\\" & thisFolder & \"\\\" _
  & objNextLink.GetNthURL(myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile, Index) _
  & \"\"\" border=\"\"1\"\"><br><br>\" & picDescription)
Set objNextLink = Nothing
%>
</div>
Avatar billede starf Nybegynder
16. april 2001 - 16:58 #5
Hmm stadig

Response object error \'ASP 0156 : 80004005\'

Header Error

/show.asp, line 6

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
Avatar billede netsrac Praktikant
16. april 2001 - 18:47 #6
Hvis
  <%
Response.Buffer = True
%>

står i filen commom.asp så fjern det her og brug det bjarke-b lagde som svar.
Avatar billede starf Nybegynder
17. april 2001 - 15:38 #7
Sorry jeg har taget så lang tid om at skrive tilbage.. Men blev hammer syg :O(
Virker stadig ikke.. common filen ser sådan her ud:
<%
Response.Buffer = True
%>
<%
Dim myTextFile              \'name to give to all Text Linking files
Dim myFolder                \'name of main folder where pictures are in
Dim mySeparator            \'special characters to separate the description

\'********change these **********

myTextFile = \"ContLink.txt\"
myFolder = \"upload\"
mySeparator = \"#####\"

\'*******************************

Dim objFSO                  \'instance of FileSystemObject component
Dim objPicturesFolder      \'to access the main picture folder
Dim collPicturesFolders    \'collection of folders under pictures folder
Dim indPicturesFolder      \'a folder in the folders collection
Dim objthisFolder          \'object to hold the individual folder
Dim thisFolder              \'specific folder to show from request
Dim objFile                \'a file under the individual pictures folder
Dim count                    \'to count all the files in every folder
Dim myTextPath                \'full path of the text file
Dim myFolderPath            \'full path of pictures folder

Dim objNextLink            \'instance of NextLink component
Dim objContLinkFile        \'to access the Content Linking text file
Dim objTStream              \'object to write the text stream to
Dim Index                  \'which picture to show?
Dim TotalItems              \'total number of records in content text file
Dim NumSeconds              \'seconds to wait before switching pictures
Dim strToWrite              \'string to write to text file
Dim intLoop                \'to help in the loop
Dim picURL                  \'URL of the picture in text linking file
Dim picWholeDescription    \'Title and Desciption of picture separated by the Separator
Dim picTitle                \'Title of picture: left of separator
Dim picDescription          \'Description of picture: right of separator
Dim picPositionSeparator    \'where is the mySeparator located in the picWholeDescription
%>
Avatar billede bjarke-b Nybegynder
17. april 2001 - 15:42 #8
<%
Dim myTextFile              \'name to give to all Text Linking files
Dim myFolder                \'name of main folder where pictures are in
Dim mySeparator            \'special characters to separate the description

\'********change these **********

myTextFile = \"ContLink.txt\"
myFolder = \"upload\"
mySeparator = \"#####\"

\'*******************************

Dim objFSO                  \'instance of FileSystemObject component
Dim objPicturesFolder      \'to access the main picture folder
Dim collPicturesFolders    \'collection of folders under pictures folder
Dim indPicturesFolder      \'a folder in the folders collection
Dim objthisFolder          \'object to hold the individual folder
Dim thisFolder              \'specific folder to show from request
Dim objFile                \'a file under the individual pictures folder
Dim count                    \'to count all the files in every folder
Dim myTextPath                \'full path of the text file
Dim myFolderPath            \'full path of pictures folder

Dim objNextLink            \'instance of NextLink component
Dim objContLinkFile        \'to access the Content Linking text file
Dim objTStream              \'object to write the text stream to
Dim Index                  \'which picture to show?
Dim TotalItems              \'total number of records in content text file
Dim NumSeconds              \'seconds to wait before switching pictures
Dim strToWrite              \'string to write to text file
Dim intLoop                \'to help in the loop
Dim picURL                  \'URL of the picture in text linking file
Dim picWholeDescription    \'Title and Desciption of picture separated by the Separator
Dim picTitle                \'Title of picture: left of separator
Dim picDescription          \'Description of picture: right of separator
Dim picPositionSeparator    \'where is the mySeparator located in the picWholeDescription
%>



Gem det som common.asp
Avatar billede netsrac Praktikant
17. april 2001 - 15:46 #9
Bjarke-b >> Min point præcis.
Avatar billede starf Nybegynder
17. april 2001 - 16:29 #10
Hmm giver stadig denne her fejl

Response object error \'ASP 0156 : 80004005\'

Header Error

/show.asp, line 6

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
Avatar billede keysersoze Ekspert
17. april 2001 - 19:45 #11
hvad så med koden på show.asp?

er det noget hvor du inkludere en masse filer i hinanden kan du risikere konflikt ved for mange response.buffer=true
Avatar billede starf Nybegynder
17. april 2001 - 20:06 #12
Show.asp ser sådan her ud...


<!--#include file=\"common.asp\" -->
<link rel=\"stylesheet\" type=\"text/css\" href=\"arf.css\">
<%
NumSeconds = Request(\"Time\")
thisFolder = Request(\"Folder\")
Index = CInt(Request(\"Index\"))
myTextPath = myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile
Set objNextLink = Server.CreateObject(\"MSWC.NextLink\")
TotalItems = objNextLink.GetListCount(myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile)
%>

<%
If NumSeconds <> \"None\" Then
    If Index = TotalItems Then
        Response.Write(\"<META HTTP-EQUIV=\"\"Refresh\"\" CONTENT=\"\"\" & NumSeconds & \";URL=list.asp?Folder=\" & thisFolder & \"\"\">\")
    Else
        Response.Write(\"<META HTTP-EQUIV=\"\"Refresh\"\" CONTENT=\"\"\" & NumSeconds _
            & \";URL=show.asp?Index=\" & Index + 1 & \"&Folder=\" _
            & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\")
    End If
End If
%>
<body bgcolor=\"#ffffff\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
  <tr bgcolor=\"#5D7484\">
    <td align=\"left\" valign=\"top\"> <%
If Index > 1 Then
    Response.Write(\"<a href=\"\"show.asp?Index=\" & Index - 1 & \"&Folder=\" _
        & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\" & \"Sidste Billede</a>\")
Else
    Response.Write(\" \")
End If
%> </td>
    <td align=\"center\" valign=\"top\"><a href=\"list.asp?Folder=<%=thisFolder%>\">Indhold</a>
      <%
Response.Write(\" [\" & Index & \"/\" & TotalItems & \"]\")
%> </td>
    <td align=\"right\" valign=\"top\"> <%
If Index >= 1 Then
    If Index < TotalItems Then
        Response.Write(\"<a href=\"\"show.asp?Index=\" & Index + 1 & \"&Folder=\" _
            & thisFolder & \"&Time=\" & NumSeconds & \"\"\">\" & \"Næste Billede</a>\")
    Else
        Response.Write(\" \")
    End If
Else
    Response.Write(\" \")
End If
%> </td>
  </tr>
</table>
<br>
<div align=\"center\">
<%
picWholeDescription = objNextLink.GetNthDescription(myTextPath, Index)
If InStr(picWholeDescription, mySeparator) Then
    picPositionSeparator = InStr(1, picWholeDescription, mySeparator)
    picTitle = Left(picWholeDescription, picPositionSeparator - 1)
    picDescription = Mid(picWholeDescription, picPositionSeparator + 5)
Else
    picTitle = picWholeDescription
    picDescription = \"\"
End If

Response.Write(\"<span style=\"\"color: #330099; font-weight: bold; font-family: Arial, Helvetica\"\">\" _
  & picTitle & \"</span><br><br>\" _
  & \"<img src=\"\"\" & myFolder & \"\\\" & thisFolder & \"\\\" _
  & objNextLink.GetNthURL(myFolder & \"\\\" & thisFolder & \"\\\" & myTextFile, Index) _
  & \"\"\" border=\"\"1\"\"><br><br>\" & picDescription)
Set objNextLink = Nothing
%>
</div>
Avatar billede starf Nybegynder
17. april 2001 - 20:13 #13
Hmm ser ud til at virke på nogle server og på andre ikke..... underligt..... for har lige uploadet alt til http://www.friserverplads.dk/madsholme/galleri.asp

Men min acces database virker ikek der.. der står der følgen fejl:

Microsoft OLE DB Provider for ODBC Drivers error \'80004005\'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key \'Temporary (volatile) Jet DSN for process 0x890 Thread 0x7e8 DBC 0xa45d51c Jet\'.

/madsholme/Default.asp, line 34

og har også lagt min database op på filserver.dk for at prøve og se om den virker der.. og der får jeg følgende fejl.

Microsoft OLE DB Provider for ODBC Drivers error \'80004005\'

[Microsoft][ODBC Microsoft Access 97 Driver] Can\'t open database \'(unknown)\'. It may not be a database that your application recognizes, or the file may be corrupt.

/default.asp, line 62

men den virker fint på min IIS.. (og da det er en hp til et firma jeg bruger den acces database i, så skal den gerne virker når jeg aflevære den) men hvad skal jeg tro på? at det er deres server det er galt med eller at det min database der ikek virker?
Btw den fejl med galleri.asp det er på filserver.dk jeg får den.

http://meddle.filserver.dk/galleri.asp
Avatar billede starf Nybegynder
18. april 2001 - 15:35 #14
det sværer er der ingen af jer der har svaret rigtigt.. og da jeg efter hånden selv fik det til at virke.. (tog tid men kom da).. så lukker jeg spørgsmålet.
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