Visualizzazione dei risultati da 1 a 7 su 7

Discussione: perchè fa così?((

  1. #1

    perchè fa così?((

    Perchè il seguente codice da l'errore che segue?

    <%
    Sub DisplayPhoto()

    CreateTopTable "Immagini", GetTranslation("LANG_LISTEN_TO_PHOTO")

    Dim oCn, oRs, rSQL, idMIN, idMAX, idSELECT, iPath
    on error resume next

    Set oCn = DBConnexion(DB_ABSOLUTEIG)
    rSQL = "SELECT min(imageid) as MIN, max(imageid) as MAX FROM xlaAIGimages where iValid = 1"
    Set oRs = DBRecordSet(oCn, rSQL)
    idMIN = Server.URLEncode(oRs("MIN"))
    idMAX = Server.URLEncode(oRs("MAX"))
    oRs.Close
    set oRs = Nothing

    Randomize
    idSELECT = Int((idMAX-idMIN) * Rnd) + idMIN
    rSQL = "SELECT * FROM xlaAIGimages where status = 1 and imageid >= " & idSELECT
    Set oRs = DBRecordSet(oCn, rSQL)
    iPath = oRs("iSourceSmall")
    Response.Write ("<table class=""immagini"" align=""center"" border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">") & vbCRLF
    Response.Write("<tr border=""0"">") & vbCRLF
    Response.Write " <td align=""center"" valign=""middle"" >" & vbCRLF
    if iPath <> "" then

    Response.Write "[img][/img]"
    Response.Write "<div class=""imgtitle"">" & oRs("imagename") & "(" & oRs("hits") & ")"& "</div>"
    End if
    Response.Write " </tr></td>" & vbCRLF

    Response.Write " </table>" & vbCRLF

    oRs.Close
    set oRs = Nothing
    oCn.Close
    set oCn = Nothing


    CreateBottomTable ""

    End Sub
    %>





    ErroreSQL -2147467259: [Microsoft][Driver ODBC Microsoft Access]Errore generale. Impossibile aprire la chiave 'Temporary (volatile) Jet DSN for process 0xd8c Thread 0x9dc DBC 0x1de4014 Jet' del Registro di sistema.
    Connection String : DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\miosito.com\mdb-database\

    ErroreSQL 3704: L'operazione non è consentita se l'oggetto è chiuso.
    SQL : SELECT min(imageid) as MIN, max(imageid) as MAX FROM xlaAIGimages where iValid = 1

    ErroreSQL 3704: L'operazione non è consentita se l'oggetto è chiuso.
    SQL : SELECT * FROM xlaAIGimages where status = 1 and imageid >= 0

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Percorso errato al db errato.

    Roby

  3. #3
    grazie, ho risolto..
    adesso però mi da questo:


    ErroreSQL 424: Necessario oggetto
    SQL : SELECT min(imageid) as MIN, max(imageid) as MAX FROM xlaAIGimages where status = 1

    ErroreSQL 424: Necessario oggetto
    SQL : SELECT * FROM xlaAIGimages where status = 1 and imageid >= 0

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    MIN e MAX sono parole riservate.

    Roby

  5. #5
    hm, che intendi scusa?

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Che l'alias usato non può essere una parola riservata.

    Roby

  7. #7
    ascò, io avevo il seguente codice:

    Dim oCn, oRs, rSQL, idMIN, idMAX, idSELECT, iPath
    on error resume next

    Set oCn = DBConnexion(DB_MAIN)
    rSQL = "SELECT min(iID) as MIN, max(iID) as MAX FROM images where iValid = 1"
    Set oRs = DBRecordSet(oCn, rSQL)
    idMIN = Server.URLEncode(oRs("MIN"))
    idMAX = Server.URLEncode(oRs("MAX"))
    oRs.Close
    set oRs = Nothing

    Randomize
    idSELECT = Int((idMAX-idMIN) * Rnd) + idMIN
    rSQL = "SELECT * FROM images where iValid = 1 and iID >= " & idSELECT
    Set oRs = DBRecordSet(oCn, rSQL)
    iPath = oRs("iSourceSmall")
    Response.Write ("<table class=""immagini"" align=""center"" border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">") & vbCRLF
    Response.Write("<tr border=""0"">") & vbCRLF
    Response.Write " <td align=""center"" valign=""middle"" >" & vbCRLF
    if iPath <> "" then

    Response.Write "[img][/img]"
    Response.Write "<div class=""imgtitle"">" & oRs("iTitle") & "(" & oRs("iHits") & ")"& "</div>"
    End if
    Response.Write " </tr></td>" & vbCRLF

    Response.Write " </table>" & vbCRLF

    oRs.Close
    set oRs = Nothing
    oCn.Close
    set oCn = Nothing


    CreateBottomTable ""

    End Sub
    %>


    e funzionava benissimo... ora ho il seguente, che sto cercando di adattare ad un altro database:


    <%
    Sub DisplayPhoto()

    CreateTopTable "Immagini", GetTranslation("LANG_LISTEN_TO_PHOTO")

    Dim oCn, oRs, rSQL, idMIN, idMAX, idSELECT, iPath
    on error resume next

    Set oCn = DBConnexion(DB_absoluteig.mdb)
    rSQL = "SELECT min(imageid) as MIN, max(imageid) as MAX FROM xlaAIGimages where status = 1"
    Set oRs = DBRecordSet(oCn, rSQL)
    idMIN = Server.URLEncode(oRs("MIN"))
    idMAX = Server.URLEncode(oRs("MAX"))
    oRs.Close
    set oRs = Nothing

    Randomize
    idSELECT = Int((idMAX-idMIN) * Rnd) + idMIN
    rSQL = "SELECT * FROM xlaAIGimages where status = 1 and imageid >= " & idSELECT
    Set oRs = DBRecordSet(oCn, rSQL)
    iPath = oRs("iSourceSmall")
    Response.Write ("<table class=""immagini"" align=""center"" border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">") & vbCRLF
    Response.Write("<tr border=""0"">") & vbCRLF
    Response.Write " <td align=""center"" valign=""middle"" >" & vbCRLF
    if iPath <> "" then

    Response.Write "[img][/img]"
    Response.Write "<div class=""imgtitle"">" & oRs("imagename") & "(" & oRs("hits") & ")"& "</div>"
    End if
    Response.Write " </tr></td>" & vbCRLF

    Response.Write " </table>" & vbCRLF

    oRs.Close
    set oRs = Nothing
    oCn.Close
    set oCn = Nothing


    CreateBottomTable ""

    End Sub
    %>

    e mi restituisce appunto come errore

    ErroreSQL 424: Necessario oggetto
    SQL : SELECT min(imageid) as MIN, max(imageid) as MAX FROM xlaAIGimages where status = 1

    ErroreSQL 424: Necessario oggetto
    SQL : SELECT * FROM xlaAIGimages where status = 1 and imageid >= 0

    se fosse come dici tu, non avrebbe funzionato nemmeno prima

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.