IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP Discussion :

Erreur de compilation Microsoft VBScript erreur '800a03ea'


Sujet :

ASP

  1. #1
    Membre actif
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Septembre 2006
    Messages
    389
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2006
    Messages : 389
    Points : 244
    Points
    244
    Par défaut Erreur de compilation Microsoft VBScript erreur '800a03ea'
    Bonjour,

    J'ai deux fichiers asp, dans mon second fichier j'ai créé une classe appelée AVEImgClass.

    Lorsque j'appelle (par mon navigateur) le fichier qui include la classe tout fonctionne, par contre quand j'appelle ce fichier par l'intermédiaire d'un menu j'ai un message d'erreur m'indiquant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    Erreur de compilation Microsoft VBScript erreur '800a03ea' 
     
    Erreur de syntaxe 
     
    /incV3.2/scripts/AVEImgClass.asp, ligne 3 
     
    Class AVEImgClass
    ^
    Voici le code du fichier ou se trouve ma classe

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    <%
     
    Class AVEImgClass
     
      ' Global Variables
      Dim p_Height
      Dim p_Width
      Dim p_Depth
      Dim p_ImageType
      Dim p_FilePhysicalPath
     
      ' Initialize
      Public Sub Class_Initialize()
        Me.SetWidth = -1
        Me.SetHeight = -1
        Me.SetDepth = -1
        Me.SetImageType = "UNKNOWN"
      End Sub
     
      ' Class Properties
      Public Property Let SetHeight(inHeight)
        p_Height = inHeight
      End Property
     
      Public Property Let SetWidth(inWidth)
        p_Width = inWidth
      End Property
     
      Public Property Let SetDepth(inDepth)
        p_Depth = inDepth
      End Property
     
      Public Property Let SetImageType(inImageType)
        p_ImageType = inImageType
      End Property
     
      Public Property Let SetFilePhysicalPath(inFilePhysicalPath)
        p_FilePhysicalPath = inFilePhysicalPath
      End Property
     
      Public Property Get GetHeight()
        GetHeight = p_Height
      End Property
     
      Public Property Get GetWidth()
        GetWidth = p_Width
      End Property
     
      Public Property Get GetDepth()
        GetDepth = p_Depth
      End Property
     
      Public Property Get GetImageType()
        GetImageType = p_ImageType
      End Property
     
      Public Property Get GetFilePhysicalPath()
        GetFilePhysicalPath = p_FilePhysicalPath
      End Property
     
      ' Class Functions
      ' The following two functions converts two bytes
      ' to a numeric value (long)
      Public Function LittleEndian(inBytes)
        LittleEndian = CLng(Asc(Left(inBytes, 1))) + (Asc(Right(inBytes, 1)) * 256)
      End Function
     
      Public Function BigEndian(inBytes)
        BigEndian = CLng(Asc(Right(inBytes, 1))) + (Asc(Left(inBytes, 1)) * 256)
      End Function
     
      Public Function GetBytes(inFile, inOffset, inBytes)
        ' This function gets a specified number of bytes from
        ' any file, starting at the passed offset
        ' Three parameters :
        '   - inFile   : File physical path to read
        '   - inOffset : Offset at which to start reading
        '   - inBytes  : Number of bytes to read (if -1 then ReadAll)
        Dim oFSO
        Dim oFile
        Dim FileSize
        Dim FSOForReading
        Dim s_Buffer
     
        On Error Resume Next
     
        ' We get the file size
        Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
        Set oFile = oFSO.GetFile(inFile)
        FileSize = oFile.Size
        Set oFile = Nothing
     
        ' We read the file from inOffset
        FSOForReading = 1
        Set oFile = oFSO.OpenTextFile(inFile, FSOForReading)
        If inOffset > 0 Then
          s_Buffer = oFile.Read(inOffset - 1)
        End If
        If inBytes = -1 Then
          ' Read All
          s_Buffer = oFile.Read(FileSize)
        Else
          s_Buffer = oFile.Read(inBytes)
        End If
        oFile.Close
        Set oFile = Nothing
        Set oFSO = Nothing
        GetBytes = s_Buffer
      End Function
     
      Public Sub GetFileSpec()
        ' This sub will run the process and set all the properties
        Dim FilePath
        Dim s_PNG
        Dim s_GIF
        Dim s_BMP
        Dim s_Type
        Dim s_Depth
        Dim s_Buffer
        Dim BufferSize
        Dim FlagFound
        Dim s_Search
        Dim ExitLoop
     
        ' We get the file physical path
        FilePath = Me.GetFilePhysicalPath
     
        ' Let's set Images Types
        s_PNG = Chr(137) & Chr(80) & Chr(78)
        s_GIF = "GIF"
        s_BMP = Chr(66) & Chr(77)
     
        ' Let's get the file type
        s_Type = Me.GetBytes(FilePath, 0, 3)
     
        If s_Type = s_GIF Then
          ' This is a GIF file
          Me.SetImageType = "GIF"
          Me.SetWidth = Me.LittleEndian(Me.GetBytes(FilePath, 7, 2))
          Me.SetHeight = Me.LittleEndian(Me.GetBytes(FilePath, 9, 2))
          Me.SetDepth = 2 ^ ((Asc(Me.GetBytes(FilePath, 11, 1)) And 7) + 1)
        ElseIf Left(s_Type, 2) = s_BMP Then
          ' This is a BMP file
          Me.SetImageType = "BMP"
          Me.SetWidth = Me.LittleEndian(Me.GetBytes(FilePath, 19, 2))
          Me.SetHeight = Me.LittleEndian(Me.GetBytes(FilePath, 23, 2))
          Me.SetDepth = 2 ^ (Asc(Me.GetBytes(FilePath, 29, 1)))
        ElseIf s_Type = s_PNG Then
          ' This is a PNG file
          Me.SetImageType = "PNG"
          Me.SetWidth = Me.BigEndian(Me.GetBytes(FilePath, 19, 2))
          Me.SetHeight = Me.BigEndian(Me.GetBytes(FilePath, 23, 2))
          s_Depth = Me.GetBytes(FilePath, 25, 2)
          Select Case Asc(Right(s_Depth, 1))
            Case 0
              Me.SetDepth = 2 ^ Asc(Left(s_Depth, 1))
            Case 2
              Me.SetDepth = 2 ^ (Asc(Left(s_Depth, 1)) * 3)
            Case 3
              Me.SetDepth = 2 ^ Asc(Left(s_Depth, 1))
            Case 4
              Me.SetDepth = 2 ^ (Asc(Left(s_Depth, 1)) * 2)
            Case 6
              Me.SetDepth = 2 ^ (Asc(Left(s_Depth, 1)) * 4)
            Case Else
              Me.SetDepth = -1
          End Select
        Else
          ' We get all the bytes of the file
          s_Buffer = Me.GetBytes(FilePath, 0, -1)
          BufferSize = Len(s_Buffer)
          FlagFound = 0
          ' We search for a JPEG file
          s_Search = Chr(255) & Chr(216) & Chr(255)
          FlagFound = InStr(s_Buffer, s_Search)
          If FlagFound = 0 Then
            Exit Sub
          End If
          Me.SetImageType = "JPG"
          FlagFound = FlagFound + 2
          ExitLoop = False
          Do While ExitLoop = False And FlagFound < BufferSize
            Do While Asc(Mid(s_Buffer, FlagFound, 1)) = 255 And FlagFound < BufferSize
              FlagFound = FlagFound + 1
            Loop
            If Asc(Mid(s_Buffer, FlagFound, 1)) < 192 Or Asc(Mid(s_Buffer, FlagFound, 1)) > 195 Then
              FlagFound = FlagFound + Me.BigEndian(Mid(s_Buffer, FlagFound + 1, 2)) + 1
            Else
              ExitLoop = True
            End If
          Loop
          If ExitLoop = False Then
            Me.SetWidth = -1
            Me.SetHeight = -1
            Me.SetDepth = -1
          Else
            Me.SetWidth = Me.BigEndian(Mid(s_Buffer, FlagFound + 6, 2))
            Me.SetHeight = Me.BigEndian(Mid(s_Buffer, FlagFound + 4, 2))
            Me.SetDepth = 2 ^ (Asc(Mid(s_Buffer, FlagFound + 8, 1)) * 8)
          End If
        End If
      End Sub
     
    End Class
     
    %>
    Pouvez vous m'aider ?

    Merci

  2. #2
    Membre actif
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Septembre 2006
    Messages
    389
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2006
    Messages : 389
    Points : 244
    Points
    244
    Par défaut
    Il semblerait que ce soit l'appel de ma class qui pose problème.

    Pour l'appeler je fait
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <!--#include File = "AVEImgClass.asp"-->
    Pourtant ma syntaxe semble correcte

    Y a t-il quelque chose à faire en particulier quand on appel un fichier asp contenant une class ?

    Merci

  3. #3
    Expert éminent
    Avatar de Immobilis
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Mars 2004
    Messages
    6 559
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Mars 2004
    Messages : 6 559
    Points : 9 506
    Points
    9 506
    Par défaut
    Salut,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <!--#include File = "AVEImgClass.asp"-->
    Ne te permet que de mettre à disposition le code.
    Pour te servir d'une classe, tu dois instancier l'objet avec un Set/New. Jette un oeil ici: http://www.developpez.net/forums/sho...d.php?t=503798

    A+
    "Winter is coming" (ma nouvelle page d'accueil)

  4. #4
    Modérateur
    Avatar de roro06
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    1 480
    Détails du profil
    Informations personnelles :
    Âge : 54
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 1 480
    Points : 1 978
    Points
    1 978
    Par défaut
    Bonjour

    Dans une classe, plutot que dim, utilise les attributs private ou public

    Je pense qu'il doit y avoir une erreur dans la page qui contient :
    <!--#include File = "AVEImgClass.asp"-->


    N'oubliez pas de consulter les FAQ ASP et les cours et tutoriels ASP

    " La vie c'est quelque chose de très fort et de très beau.... La vie appartient a tous les vivants. It's both a dream and a feeling. C'est être ce que nous ne sommes pas sans le rester. La vie c'est mourir aussi....Et mourir c'est vraiment strong...c'est rester en vie au delà de la mort...Tous ceux qui sont morts n'ignorent pas de le savoir."
    (J.C. VanDamme, humoriste et philosophe belge . A moins que ce ne soit l'inverse ...)

    Chuck Norris comprend JC Van Damme.

  5. #5
    Membre actif
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Septembre 2006
    Messages
    389
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2006
    Messages : 389
    Points : 244
    Points
    244
    Par défaut
    Merci pour vos reponses

    Je vais donc recherché le probleme de mon code en suivant vos conseils

    Merci et bonne journée

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. erreur d'exécution Microsoft VBScript erreur '800a01ad'
    Par fathitaouni dans le forum VBScript
    Réponses: 1
    Dernier message: 05/02/2013, 10h22
  2. Réponses: 10
    Dernier message: 30/09/2008, 15h58
  3. Réponses: 11
    Dernier message: 08/07/2008, 20h55
  4. Réponses: 2
    Dernier message: 11/04/2007, 15h04
  5. Réponses: 2
    Dernier message: 24/05/2006, 22h57

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo