Får følgende fejl. ved billedevisning
Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/inetpub/Møller/billeder/index.asp, line 10
Koden på index.asp ser sådan her ud..
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ConUpload.asp" -->
<%
Dim rsPro
Dim rsPro_numRows
Set rsPro = Server.CreateObject("ADODB.Recordset")
rsPro.ActiveConnection = MM_ConUpload_STRING 'LINIE 10
rsPro.Source = "SELECT * FROM album ORDER BY ID DESC"
rsPro.CursorType = 0
rsPro.CursorLocation = 2
rsPro.LockType = 1
rsPro.Open()
rsPro_numRows = 0
%>
<%
FUNCTION CropSentence(strText, intLength, strTrial)
Dim wsCount
Dim intTempSize
Dim intTotalLen
Dim strTemp
wsCount = 0
intTempSize = 0
intTotalLen = 0
intLength = intLength - Len(strTrial)
strTemp = ""
IF Len(strText) > intLength THEN
arrTemp = Split(strText, " ")
FOR EACH x IN arrTemp
IF Len(strTemp) <= intLength THEN
strTemp = strTemp & x & " "
END IF
NEXT
CropSentence = Left(strTemp, Len(strTemp) - 1) & strTrial
ELSE
CropSentence = strText
END IF
END FUNCTION
%>
<% Session("svPic") = (rsPro.Fields.Item("ID").Value) %>
<%
Dim HLooper1__numRows
HLooper1__numRows = 30
Dim HLooper1__index
HLooper1__index = 0
rsPro_numRows = rsPro_numRows + HLooper1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim rsPro_total
Dim rsPro_first
Dim rsPro_last
' set the record count
rsPro_total = rsPro.RecordCount
' set the number of rows displayed on this page
If (rsPro_numRows < 0) Then
rsPro_numRows = rsPro_total
Elseif (rsPro_numRows = 0) Then
rsPro_numRows = 1
End If
' set the first and last displayed record
rsPro_first = 1
rsPro_last = rsPro_first + rsPro_numRows - 1
' if we have the correct record count, check the other stats
If (rsPro_total <> -1) Then
If (rsPro_first > rsPro_total) Then
rsPro_first = rsPro_total
End If
If (rsPro_last > rsPro_total) Then
rsPro_last = rsPro_total
End If
If (rsPro_numRows > rsPro_total) Then
rsPro_numRows = rsPro_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (rsPro_total = -1) Then
' count the total records by iterating through the recordset
rsPro_total=0
While (Not rsPro.EOF)
rsPro_total = rsPro_total + 1
rsPro.MoveNext
Wend
' reset the cursor to the beginning
If (rsPro.CursorType > 0) Then
rsPro.MoveFirst
Else
rsPro.Requery
End If
' set the number of rows displayed on this page
If (rsPro_numRows < 0 Or rsPro_numRows > rsPro_total) Then
rsPro_numRows = rsPro_total
End If
' set the first and last displayed record
rsPro_first = 1
rsPro_last = rsPro_first + rsPro_numRows - 1
If (rsPro_first > rsPro_total) Then
rsPro_first = rsPro_total
End If
If (rsPro_last > rsPro_total) Then
rsPro_last = rsPro_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (rsPro_total = -1) Then
' count the total records by iterating through the recordset
rsPro_total=0
While (Not rsPro.EOF)
rsPro_total = rsPro_total + 1
rsPro.MoveNext
Wend
' reset the cursor to the beginning
If (rsPro.CursorType > 0) Then
rsPro.MoveFirst
Else
rsPro.Requery
End If
' set the number of rows displayed on this page
If (rsPro_numRows < 0 Or rsPro_numRows > rsPro_total) Then
rsPro_numRows = rsPro_total
End If
' set the first and last displayed record
rsPro_first = 1
rsPro_last = rsPro_first + rsPro_numRows - 1
If (rsPro_first > rsPro_total) Then
rsPro_first = rsPro_total
End If
If (rsPro_last > rsPro_total) Then
rsPro_last = rsPro_total
End If
End If
%>
<%
Dim MM_paramName
%>
<%
' *** Move To Record and Go To Record: declare variables
Dim MM_rs
Dim MM_rsCount
Dim MM_size
Dim MM_uniqueCol
Dim MM_offset
Dim MM_atTotal
Dim MM_paramIsDefined
Dim MM_param
Dim MM_index
Set MM_rs = rsPro
MM_rsCount = rsPro_total
MM_size = rsPro_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links
Dim MM_keepMove
Dim MM_moveParam
Dim MM_moveFirst
Dim MM_moveLast
Dim MM_moveNext
Dim MM_movePrev
Dim MM_urlStr
Dim MM_paramList
Dim MM_paramIndex
Dim MM_nextParam
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 1) Then
MM_moveParam = "offset"
If (MM_keepMove <> "") Then
MM_paramList = Split(MM_keepMove, "&")
MM_keepMove = ""
For MM_paramIndex = 0 To UBound(MM_paramList)
MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
End If
Next
If (MM_keepMove <> "") Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If
' set the strings for the move to links
If (MM_keepMove <> "") Then
MM_keepMove = Server.HTMLEncode(MM_keepMove) & "&"
End If
MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = MM_urlStr & "0"
MM_moveLast = MM_urlStr & "-1"
MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size)
If (MM_offset - MM_size < 0) Then
MM_movePrev = MM_urlStr & "0"
Else
MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
' use index parameter if defined, otherwise use offset parameter
MM_param = Request.QueryString("index")
If (MM_param = "") Then
MM_param = Request.QueryString("offset")
End If
If (MM_param <> "") Then
MM_offset = Int(MM_param)
End If
' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' move the cursor to the selected record
MM_index = 0
While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
If (MM_rs.EOF) Then
MM_offset = MM_index ' set MM_offset to the last possible record
End If
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
MM_index = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = MM_index
If (MM_size < 0 Or MM_size > MM_rsCount) Then
MM_size = MM_rsCount
End If
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
MM_index = 0
While (Not MM_rs.EOF And MM_index < MM_offset)
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
rsPro_first = MM_offset + 1
rsPro_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (rsPro_first > MM_rsCount) Then
rsPro_first = MM_rsCount
End If
If (rsPro_last > MM_rsCount) Then
rsPro_last = MM_rsCount
End If
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
</SCRIPT>
<html>
<head>
<title>MXMANIA Asp Upload Resize Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="assets/style_sheets/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function showPopup(wUrl,wName,w,h,l,t,scroll){
settings='width=' + w +',height=' + h +',top=' + t + ',left=' + l +',scrollbars=' + scroll +',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
popupWin=window.open(wUrl,wName,settings);
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// Flash Image Extension for Dreamwever ,by Yichun Yuan(dezone@sina.com)
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ //do this so I can take a string too
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
//-->
</script>
<style type="text/css">
<!--
body {
margin-top: 0px;
margin-bottom: 0px;
}
.style2 {font-weight: bold}
-->
</style></head>
<body class="scroll">
<table width="100%" border="0" align="center">
<tr>
<td height="400"><table border="0" align="center" >
<tr valign="middle" >
<td colspan="2" align="left" class="headline"><div align="right"><a href="http://www.mxmania.net" target="_blank"><img src="assets/images/powered_mxmania.gif" width="135" height="13" border="0" align="middle"></a></div></td>
</tr>
<tr >
<td align="left" valign="top" class="Fields style2"><div align="center" class="headline"><strong>Click Thumbnails to view Full Size PIC (<font size="2"><font face="Georgia, Times New Roman, Times, serif"><a href="java script:;">Total Pics <%=(rsPro_total)%></a></font></font>) </strong></div></td>
<td align="left" valign="middle" class="headline"><div align="center"><a href="photo_upload.asp" target="_self" ><strong>Upload Pics</strong></a></div></td>
</tr>
<tr valign="middle" >
<td colspan="2" align="left" class="headline"><% If Not rsPro.EOF Or Not rsPro.BOF Then %>
<table align="center">
<%
startrw = 0
endrw = HLooper1__index
numberColumns = 5
numrows = 6
while((numrows <> 0) AND (Not rsPro.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%>
<tr align="center" valign="top">
<%
While ((startrw <= endrw) AND (Not rsPro.EOF))
%>
<td><table border="0" >
<tr>
<td class="Fields"><div align="center"><A HREF="detail.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "ID=" & rsPro.Fields.Item("ID").Value %>" target="_blank"><img src="images/<%=(rsPro.Fields.Item("pic_thumb").Value)%>" alt="Click to view Full Size PIC" border="0" style="FILTER: alpha(opacity=40);" onMouseOver=nereidFade(this,100,1,10) onMouseOut=nereidFade(this,70,1,10)></A></div></td>
</tr>
<tr>
<td bgcolor="#CCCCCC" class="headline"><strong><font size="1" face="Georgia, Times New Roman, Times, serif">Height : <%=(rsPro.Fields.Item("height").Value)%></font></strong></td>
</tr>
<tr>
<td bgcolor="#CCCCCC" class="headline"><strong><font size="1" face="Georgia, Times New Roman, Times, serif">Width: <%=(rsPro.Fields.Item("width").Value)%></font></strong></td>
</tr>
<tr>
<td bgcolor="#CCCCCC" class="headline"><% =(CropSentence((rsPro.Fields.Item("Title").Value), 12, "...")) %></td>
</tr>
<tr>
<td bgcolor="#CCCCCC" class="headline">Added: <%= DoDateTime((rsPro.Fields.Item("upload_date").Value), 2, 1030) %></td>
</tr>
</table></td>
<%
startrw = startrw + 1
rsPro.MoveNext()
Wend
%>
</tr>
<%
numrows=numrows-1
Wend
%>
</table>
<br>
<table width="400" border="0" align="center">
<tr>
<td class="cellover"><div align="center" class="headline"><strong>
<%
For i = 1 to rsPro_total Step MM_size
TM_endCount = i + MM_size - 1
if TM_endCount > rsPro_total Then TM_endCount = rsPro_total
if i <> MM_offset + 1 Then
Response.Write("<a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")
Response.Write(i & "-" & TM_endCount & "</a>")
else
Response.Write("<b>" & i & "-" & TM_endCount & "</b>")
End if
if(TM_endCount <> rsPro_total) then Response.Write(" | ")
next
%>
</strong></div></td>
</tr>
</table>
<% End If ' end Not rsPro.EOF Or NOT rsPro.BOF %>
<% If rsPro.EOF And rsPro.BOF Then %>
<table border="0" align="center" >
<tr>
<td width="126" height="21" bordercolor="#999999" class="headline"><div align="center"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">NO PICS TO VIEW</font></strong></div></td>
</tr>
</table>
<% End If ' end rsPro.EOF And rsPro.BOF %>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
rsPro.Close()
Set rsPro = Nothing
%>
