Fejl i linien Const cnstmandMappe = Firma
Hejsa, jeg har denne kode, men jeg får fejl iConst cnstmandMappe = Firma
men det virker fint med fx. Const cnstmandMappe = "Mappenavn"
<%
If Request.QueryString("ID") <> 0 Then
Call OpenDataBase("projekt.mdb")
Set objRS = objConn.Execute("SELECT * FROM Firma WHERE Id = " & Request.QueryString("id") & "")
If (Not objRS.BOF) And (Not objRS.EOF) Then
objRS.MoveFirst
Dim Firma
While Not objRS.EOF
Firma = objRS("Firmanavn")
%>
<table border="0" align="center">
<tr>
<td><%=Firma%></td>
</tr>
<tr>
<td><%=objRS("Adresse")%></td>
</tr>
<tr>
<td><%=objRS("Postnr")%> <%=objRS("Bynavn")%></td>
</tr>
<tr>
<td>Tlf: <%=objRS("Tlf")%></td>
</tr>
<tr>
<td>Fax: <%=objRS("Fax")%></td>
</tr>
<tr>
<td><a href="mailto:<%=objRS("Email")%>"><%=objRS("Email")%></a></td>
</tr>
<tr>
<td>
<%
objRS.MoveNext
Wend
End If
Call CloseDataBase
Const cnstmandMappe = Firma
Function GetExtension(strFileName)
Dim strWork
Dim I
strWork = ""
For I = Len(strFileName) To 1 Step - 1
If Mid(strFileName, I, 1) = "." Then
strWork = LCase(Mid(strFileName, I + 1, Len(strFileName)))
I = 1
End If
Next
GetExtension = strWork
End Function
Sub ListPictures
Const intMaxFiles = 1
Dim objFSO
Dim objFolder
Dim objFile
Dim arrFileList()
Dim intFiles
Dim intCurrentPage
Dim intTotalPages
Dim intStart
Dim intSlut
Dim I
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(cnstmandMappe))
intFiles = 0
For Each objFile In objFolder.Files
If GetExtension(objFile.Name) = "gif" Then
intFiles = intFiles + 1
ReDim Preserve arrFileList(intFiles)
arrFileList(intFiles) = objFile.Name
End If
Next
If (IsNumeric(Request.QueryString("page"))) And (Request.QueryString("page") <> "") Then
intCurrentPage = CLng(Request.QueryString("page"))
Else
intCurrentPage = 1
End If
intTotalPages = CLng(intFiles / intMaxFiles)
If (intTotalPages * intMaxFiles) < intFiles Then
intTotalPages = intTotalPages + 1
End If
intStart = ((intCurrentPage * intMaxFiles) - intMaxFiles) + 1
intSlut = intStart + (intMaxFiles - 1)
If intSlut > intFiles Then
intSlut = intFiles
End If
Dim intAntal
intAntal = 0
Response.Write "<center><table width=""100%"" cellspacing=0 cellpadding=0 border=0>" & vbCrLf
Response.Write "<tr>" & vbCrLf
For I = intStart To intSlut
Response.Write "<td width=""33%"" align=center>" & vbCrLf
Dim strWork
strWork = Replace(arrFileList(I), "gif", "jpg", 1, -1, 1)
Response.Write "<a href=" & Chr(34) & cnstmandMappe & "/popup.asp?filename=" & Server.HTMLEncode(strWork) & Chr(34) & " target=""_blank""><img src=" & Chr(34) & cnstmandMappe & "/" & arrFileList(I) & Chr(34) & " border=0""></a>" & vbCrLf
Response.Write "</td>" & vbCrLf
intAntal = intAntal + 1
If intAntal = 3 Then
Response.Write "</tr><tr>" & vbCrLf
intAntal = 0
End If
Next
If intAntal > 0 Then
Response.Write "</tr>" & vbCrLf
End If
Response.Write "</table>" & vbCrLf
Response.Write "<br>" & vbCrLf
If intCurrentPage > 1 Then
Response.Write "<a href=""album.asp?page=" & intCurrentPage - 1 & Chr(34) & "><<</a> " & vbCrLf
Else
Response.Write "<< " & vbCrLf
End If
For I = 1 To intTotalPages
If I <> intCurrentPage Then
Response.Write "<a href=""album.asp?page=" & I & Chr(34) & ">" & I & "</a> " & vbCrLf
Else
Response.Write "<b>" & I & "</b> " & vbCrLf
End If
Next
If intCurrentPage < intTotalPages Then
Response.Write "<a href=""album.asp?page=" & intCurrentPage + 1 & Chr(34) & ">>></a> " & vbCrLf
Else
Response.Write ">> " & vbCrLf
End If
Response.Write "<br>" & vbCrLf
End Sub
%>
</td>
</tr>
</table>
<%
End if
%>