My application run perfect
but some times i got this error for no reason
please help

Provider error '80004005' 

Unspecified error 

C:\ACCOUNTS\ZOFAN\GETSTARTED\../Functions/Global.asp, line 21

this is line 21
objRec.Open  strSQLFindPages , strConn , adOpenForwardOnly, _
                        adLockReadOnly, adCmdText



the full code is

Function FindRandomImage(no, Position)
    Dim Count
    Count = 1
    Set objRec = Server.CreateObject("ADODB.Recordset")
        strSQLFindPages = "SELECT* FROM Banners where Position ='" & Position &
"'"

        objRec.Open  strSQLFindPages , strConn , adOpenForwardOnly, _
                        adLockReadOnly, adCmdText
        If not objRec.EOF Then
                          While not objRec.EOF
                            if no = Count then
                                                if Position = "Top" then
                                                                
Session("RandomImageTop") = objRec("FileName")
                                                                
Session("RandomImageTopLink") = objRec("Link")
                                                elseif Position = "Left" then   
                                                        Session("RandomImageLeft") = 
objRec("FileName")
                                                                
Session("RandomImageLeftLink") = objRec("Link") 
                                                end if          
                            end if   
                                objRec.MoveNext
                            Count = Count + 1
                          Wend
        End If
        objRec.Close
        Set objRec = Nothing
end function 

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to