Avatar billede axkris Nybegynder
20. februar 2004 - 14:12 Der er 1 løsning

Data provider or other service returned an E_FAIL status

Hej

Systemet har kørt i et ½ år uden fejl og uden at jeg har ændret på koden, men pludselig melder den:

Microsoft Cursor Engine (0x80004005)
Data provider or other service returned an E_FAIL status.

Ved linien: "intPageCount = RS.PageCount"

_______________________________

<!--#INCLUDE virtual = "/forum/config.asp"-->
<!--#INCLUDE virtual = "/forum/inc_header.asp" -->

<%
if strDBNTUserName = "" then
    response.redirect "/front/index.asp?fejl_i_kalender"
end if
%>

<!--#include virtual = "/common/showAlert.asp"-->
<!--#include virtual = "/common/inc_dsn_open.asp"-->
<!--#INCLUDE virtual ="/common/inc_writeSubmenu.asp" -->
<!--#INCLUDE virtual ="/common/inc_writeTable.asp" -->

<%
WriteSubMenu "index.asp", "Kalender", "Dine arrangementer"
WriteTableStart "Dine arrangementer", strHeadCellColor, "100%", "/grafik/layout/wavyb.gif"

%>

<center>

<table border="0" cellpadding="0" cellspacing="0">

<tr width="50">
<td width="1"><img src="../common/images/clear.gif" height="1" width="1"></td>
<td width="1"><img src="../common/clear.gif" height="1" width="1"></td>
<td width="649" valign="top" height="200">

<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="100%"><br>

<%
orderBy = request.querystring("orderby")

SearchWhere = request("SearchWhere")
SearchFor = request("SearchFor")

If (SearchWhere = "All") Then
    SQL_SearchWhere = "(Event_Name LIKE ('%" & SearchFor & "%') OR Date LIKE ('%" & SearchFor & "%') OR Location LIKE ('%" & SearchFor & "%') OR Category LIKE ('%" & SearchFor & "%'))"
Else
    SQL_SearchWhere = SearchWhere & " LIKE ('%" & SearchFor & "%')"
End If

If NOT (SearchFor = "") Then
    SQL_SearchFor = " WHERE " & SQL_SearchWhere
Else
    SQL_SearchFor = ""
End If

If orderBy = "Event_Name_Up" Then
    SQL_OrderBy = " ORDER BY Event_Name DESC"
ElseIf orderBy = "Event_Name_Down" Then
    SQL_OrderBy = " ORDER BY Event_Name"
ElseIf orderBy = "Date_Up" Then
    SQL_OrderBy = " ORDER BY Date DESC"
ElseIf orderBy = "Date_Down" Then
    SQL_OrderBy = " ORDER BY Date"
ElseIf orderBy = "Location_Up" Then
    SQL_OrderBy = " ORDER BY Location DESC"
ElseIf orderBy = "Location_Down" Then
    SQL_OrderBy = " ORDER BY Location"
ElseIf orderBy = "Category_Up" Then
    SQL_OrderBy = " ORDER BY Category DESC"
ElseIf orderBy = "Category_Down" Then
    SQL_OrderBy = " ORDER BY Category"
Else
    orderBy = "Date_Down"
    SQL_OrderBy = " ORDER BY Date"
End If

if mlev = 4 then
    SQL = "SELECT * FROM KALENDER_EVENTS " & SQL_SearchFor & SQL_OrderBy
else
    SQL = "SELECT * FROM KALENDER_EVENTS where author = " & MemberID & " " &  SQL_SearchFor & SQL_OrderBy
end if
%>

<form action="admin_oversigt.asp" Method="GET">

<table border="0" cellpadding="2" cellspacing="0" align="center">
<tr>
<td><font face="<%=strDefaultFontFace%>" size="<%=strDefaultFontSize%>" color="<%=strForumFontColor%>"><b>Søg efter</b></font></td>
<td>
<input type="text" name="SearchFor" class="inputBox" value="<%=SearchFor%>" size="20"></td>
<td><font face="Verdana, arial" size="1"  color="48576C"><b>i</b></font></td>
<td><select name="SearchWhere" class="inputBox">
<option value="All" <%If (SearchWhere = "All") Then%>SELECTED<%End If%>>Alle felter</option>
<option value="Event_Name" <%If (SearchWhere = "Email") Then%>SELECTED<%End If%>>Titel</option>
<option value="Date" <%If (SearchWhere = "Name_Last") Then%>SELECTED<%End If%>>Dato</option>
<option value="Location" <%If (SearchWhere = "Date_In") Then%>SELECTED<%End If%>>Landsdel</option>
<option value="Location" <%If (SearchWhere = "Date_In") Then%>SELECTED<%End If%>>Type</option>
</select></td>
<td><input type="submit" value="Ok" class="inputSubmit"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>

<%

Set RS = Server.CreateObject("ADODB.Recordset")

dim intPage
dim intPageCount
dim intRecordCount

If Request.QueryString("page") = "" Then
    intPage = 1   
Else
    intPage = Request.QueryString("page")
End If
   
RS.CursorLocation = 3
RS.CursorType = 3
RS.ActiveConnection = DataConn
   
RS.Open SQL, DataConn, 1, 3
       
RS.PageSize = 100000
RS.CacheSize = RS.PageSize
intPageCount = RS.PageCount
intRecordCount = RS.RecordCount

If NOT (RS.BOF AND RS.EOF) Then
%>

<table border="0" cellpadding="3" cellspacing="0">
<td width="80"></td>
<td width="80" align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><b><a href="?orderby=Event_Name_Up&page=<%If NOT (orderby = "Event_Name_Up") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/aup.gif" width="10" height="10" border="0"></a>&nbsp;Titel&nbsp;<a href="?orderby=Event_Name_Down&page=<%If NOT (orderby = "Event_Name_Down") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/adown.gif" width="10" height="10" border="0"></a></b></font></td>
<td width="80" align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><b><a href="?orderby=Date_Up&page=<%If NOT (orderby = "Date_Up") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/aup.gif" width="10" height="10" border="0"></a>&nbsp;Dato&nbsp;<a href="?orderby=Date_Down&page=<%If NOT (orderby = "Date_Down") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/adown.gif" width="10" height="10" border="0"></a></b></font></td>
<td width="80" align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><b><a href="?orderby=Location_Up&page=<%If NOT (orderby = "Location_Up") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/aup.gif" width="10" height="10" border="0"></a>&nbsp;Sted&nbsp;<a href="?orderby=Location_Down&page=<%If NOT (orderby = "Location_Down") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/adown.gif" width="10" height="10" border="0"></a></b></font></td>
<td width="80" align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><b><a href="?orderby=Category_Up&page=<%If NOT (orderby = "Category_Up") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/aup.gif" width="10" height="10" border="0"></a>&nbsp;Type&nbsp;<a href="?orderby=Category_Down&page=<%If NOT (orderby = "Category_Down") Then%>1<%Else%><%=intPage%><%End If%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><img src="../common/images/adown.gif" width="10" height="10" border="0"></a></b></font></td>
</tr>

<%   
If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount
    If CInt(intPage) <= 0 Then intPage = 1
        If intRecordCount > 0 Then
            RS.AbsolutePage = intPage
            intStart = RS.AbsolutePosition
            If CInt(intPage) = CInt(intPageCount) Then
                intFinish = intRecordCount
            Else
                intFinish = intStart + (RS.PageSize - 1)
            End if
        End If
    If intRecordCount > 0 Then
        For intRecord = 1 to RS.PageSize
%>
<tr>
<td width="74">
<% Response.Write "&nbsp;<a href=""admin_aktivitet.asp?id=" & RS("ID") & """>" & getCurrentIcon(strIconPencil,"Opdater arrangementet","hspace=""0""") & "</a>"%>
<% Response.Write "&nbsp;<a href=""slet.asp?id=" & RS("ID") & """>" & getCurrentIcon(strIconTrashcan,"Slet arrangementet","hspace=""0""") & "</a>"%>

</td>
<td><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><span class="spnMessageText"><a href="arrangement.asp?id=<%=RS("ID")%>"><%=RS("Event_Name")%></a></span></font></td>
<td align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><%=FormatDateTime(RS("Date"), vbShortDate)%></font></td>
<td align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><%=RS("Location")%></font></td>
<td align="center"><font face="<%= strDefaultFontFace%>" size="<%=strDefaultFontSize %>" color="<%=strForumFontColor%>"><%=RS("Category")%></font></td>
</tr>
           
<%
RS.MoveNext
If colorchanger = 1 Then
    colorchanger = 0
    color1 = "#C5D3E7"
    color2 = "#B0C4DE"
Else
    colorchanger = 1
    color1 = "#DAE3F0"
    color2 = "#C5D3E7"
End If

If RS.EOF Then Exit for
    Next
%>
<tr>
<td colspan="5" width="441"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%" align="left"><font face="Verdana, arial" size="1">
<%If cInt(intPage) > 1 Then%>
    <a href="?orderby=<%=orderBy%>&page=<%=intPage - 1%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><< <b>Forrige</b></a>
<%End If%>
</font></td>
<td width="50%" align="right"><font face="Verdana, arial" size="1" >
<%If cInt(intPage) < cInt(intPageCount) Then%>
    <a href="?orderby=<%=orderBy%>&page=<%=intPage + 1%>&SearchFor=<%=SearchFor%>&SearchWhere=<%=SearchWhere%>"><b>Næste</b> >></a>
<%End If%>
</font></td></tr></table></td></tr></table></center>
</div>
<br>
<%
End If
End If
%>

</font></td>
<td width="1"><img src="../common/images/clear.gif" height="1" width="1"></td>
</tr>

<tr>
<td height="1" colspan="4" width="649"><img src="../common/images/clear.gif" height="1" width="1"></td>
</tr>

<tr>
<td height="1" colspan="4" width="649"><img src="../common/images/clear.gif" height="1" width="1"></td>
</tr>
</table>

  </center>

<%
WriteTableEnd
WriteFooter
Response.End
%><!--#INCLUDE virtual = "/common/inc_dsn_close.asp" -->
Avatar billede axkris Nybegynder
22. maj 2004 - 20:55 #1
Lukker og slukker
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
Computerworld tilbyder specialiserede kurser i database-management

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