Her er koden Response.Redirect lige efter indsætning af records, som så virker godt nok, men jeg syntes bare at det er lidt weird at man ikke kan få det til at virke uden Response.Redirect og kun med No Cache.
Jeg har prøvet med dine foreslag.
Vær lige opmærksom at koden er temmeligt rodet, da det er en beta model.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Response.Expires = 0
Response.AddHeader "PRAGMA", "NO-CACHE"
%>
<!--#include virtual="/Connections/ConnPic.asp" -->
<%
Dim RsErDerBillederIMappe__MMColParam
RsErDerBillederIMappe__MMColParam = "1"
If (Request.QueryString("VisMappe") <> "") Then
RsErDerBillederIMappe__MMColParam = Request.QueryString("VisMappe")
End If
%>
<%
Dim RsErDerBillederIMappe
Dim RsErDerBillederIMappe_numRows
Set RsErDerBillederIMappe = Server.CreateObject("ADODB.Recordset")
RsErDerBillederIMappe.ActiveConnection = MM_ConnPic_STRING
RsErDerBillederIMappe.Source = "SELECT * FROM PicTable WHERE PicSerie = '" + Replace(RsErDerBillederIMappe__MMColParam, "'", "''") + "'"
RsErDerBillederIMappe.CursorType = 0
RsErDerBillederIMappe.CursorLocation = 2
RsErDerBillederIMappe.LockType = 1
RsErDerBillederIMappe.Open()
RsErDerBillederIMappe_numRows = 0
%>
<%
Dim VisMappe
VisMappe = Request.Querystring("VisMappe")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<form action="fso.asp" method="get" name="VisMappe" id="VisMappe">
<p align="center"><strong>W 750 X H 563 på Originalen. <span class="style1">IKKE FASTLAGT ENDNU </span></strong></p>
<p align="center"><strong>W 150 X H 113 på thumbs</strong></p>
<table width="200" border="1" align="center" bordercolor="#333333">
<tr>
<td>Vis Mappe Nr:</td>
<td><input name="VisMappe" type="text" id="VisMappe" size="10"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="VisMappeKnap" type="submit" id="VisMappeKnap" value="Vis mappe">
</div></td>
</tr>
</table>
</form>
<p> </p>
<p>
<%
'Planen med dette script er at tilføje alle billede stierne i en mappe til en database.
'dette script tilføjer alle de store billeder, der laves et nyt til Thumbnails senere.
Dim ImageDir, PicSerie, PicSti, PicThumbSti
PicDir = Request.Querystring("VisMappe")
PicSerie = Request.Querystring("PicSerie")
' Mappen med filerne, 1 er sat til Default værdi for dette Script
If Request.QueryString("VisMappe") <> "" Then
PicDir = PicDir + ("/")
Else
PicDir = VisMappe + ("/")
End If
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(Server.MapPath(PicDir))
Set objFiles = objFolder.Files
PicCount = objFiles.Count
Response.Write "Der er <strong>" & PicCount & "</strong> filer i denne mappe :</p>"
For Each Image In objFiles
If Instr(Image.Name,"_ov") Then
Response.Write Image.Name & (" Thumb")
End If
'Response.Write Server.MapPath(".") + ("/") + PicDir + image.name & "<br>"
'Response.Write
%>
<a href="<%= ("/privat/ok/pic/") + PicDir + image.name %>"><%= Server.MapPath(".") + ("/") + PicDir + image.name %></a><br>
<br>
<%
Next
If Request.Querystring("Gem") = ("Gem") Then
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(Server.MapPath(PicDir))
Set objFiles = objFolder.Files
%><!--#include virtual="/Connections/ConnPic.inc" --><%
strSQL1 = "Insert Into PicSerieTable "
strSQL1 = strSQL1 & "(SerieNummer) "
strSQL1 = strSQL1 & "values( "
strSQL1 = strSQL1 & "'" & VisMappe & "')"
Conn.Execute(strSQL1)
intImgCount = objFiles.Count
%>
<%
For Each Image In objFiles
If Instr(Image.Name,"_ov") Then
'Ingenting da vi bare adder "_ov" til det store billede navn og sætter ind i "PicThumbSti"
Else
'Del Image.Name op så vi kan adde "_ov" inden ".FileExtension"
PicThumbSti = Image.Name
PicThumbSti = Split(PicThumbSti, ".", 2, 1)
'=PicThumbSti(0) + (".") + PicThumbSti(1)
strSQL = "Insert Into PicTable ("
strSQL = strSQL & "PicNavn, "
strSQL = strSQL & "PicSerie, "
strSQL = strSQL & "PicSti, "
strSQL = strSQL & "PicThumbSti) "
strSQL = strSQL & "values( "
strSQL = strSQL & "'" & Image.Name & "', "
strSQL = strSQL & "'" & VisMappe & "', "
strSQL = strSQL & "'" & VisMappe & Sti & ("/") & Image.Name & "', "
strSQL = strSQL & "'" & VisMappe & Sti & ("/") & PicThumbSti(0) & ("_ov") & (".") & PicThumbSti(1) & "')"
Conn.Execute(strSQL)
'Conn.Execute("Insert Into PicTable("PicNavn, PicSerie, PicSti, PicThumbSti") Values('" & Image.Name & "'", "'" & PicSerie & "'", "'" & Sti & ("/") & Image.Name & "'", "'" & Sti & ("/") & PicThumbSti(0) & ("_ov") & (".") & PicThumbSti(1) & "'")
End If
Next
Response.Redirect("fso.asp?VisMappe=" & VisMappe)
End If
strScriptName = Request.Servervariables("ScriptName")
Set objFS = Nothing
%>
</p>
<form name="form1" method="get" action="">
<% If RsErDerBillederIMappe.EOF And RsErDerBillederIMappe.BOF Then %>
<table width="200" border="1" align="center">
<tr>
<td><div align="center">
<input type="submit" name="Submit" value="Læg alle billeder i databasen">
<input name="Gem" type="hidden" id="Gem" value="Gem">
<input name="VisMappe" type="hidden" id="VisMappe" value="<% = Request.Querystring("VisMappe") %>">
</div></td>
</tr>
</table>
<% End If ' end RsErDerBillederIMappe.EOF And RsErDerBillederIMappe.BOF %>
<% If Not RsErDerBillederIMappe.EOF Or Not RsErDerBillederIMappe.BOF Then %>
<table width="200" border="1" align="center">
<tr>
<td><div align="center">Denne mappe med billeder ligger allerede i databasen </div></td>
</tr>
</table>
<% End If ' end Not RsErDerBillederIMappe.EOF Or NOT RsErDerBillederIMappe.BOF %>
</form>
<p> </p>
</body>
</html>
<%
RsErDerBillederIMappe.Close()
Set RsErDerBillederIMappe = Nothing
%>