none
Error '800a03ee' RRS feed

  • Frage

  • Microsoft VBScript compilation error '800a03ee'

    Expected ')'

    BackupCleanUp.vbs, line 18

    Private Function ParseDate (ByVal DateString As String, _
    ByVal DatePattern As String) As Date

    Bitte helfen! / Please help!
    Dienstag, 20. Dezember 2011 11:00

Antworten

  • Microsoft VBScript compilation error '800a03ee'

    Expected ')'

    BackupCleanUp.vbs, line 18

    Private Function ParseDate (ByVal DateString As String, _
    ByVal DatePattern As String) As Date

    In VBScript gibt es keine explizite Datentypdeklaration. Also sämtliche "As <Datentyp>" weg.

     


    Gruß, Stefan
    Microsoft MVP - Visual Developer ASP/ASP.NET
    http://www.asp-solutions.de/ - Consulting, Development
    http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community

    Dienstag, 20. Dezember 2011 11:23
    Moderator

Alle Antworten

  • BackupCleanUp.vbs, line 18

    Private Function ParseDate (ByVal DateString As String, _
    ByVal DatePattern As String) As Date

    VBScript ist nicht VisualBasic und nicht VBA und nicht VB.NET...
    Das ist natürlich ein Syntaxfehler.


    Martin Richter -- MVP for VC++ [Germany] -- http://blog.m-ri.de
    Dienstag, 20. Dezember 2011 11:08
    Moderator
  • Microsoft VBScript compilation error '800a03ee'

    Expected ')'

    BackupCleanUp.vbs, line 18

    Private Function ParseDate (ByVal DateString As String, _
    ByVal DatePattern As String) As Date

    In VBScript gibt es keine explizite Datentypdeklaration. Also sämtliche "As <Datentyp>" weg.

     


    Gruß, Stefan
    Microsoft MVP - Visual Developer ASP/ASP.NET
    http://www.asp-solutions.de/ - Consulting, Development
    http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community

    Dienstag, 20. Dezember 2011 11:23
    Moderator
  • Ok, vielen Dank!

    Meine VBScript:

    Private Function ParseDate(ByVal DateString, ByVal DatePattern)

        Dim strStringParts()
        Dim strPatternParts()
        Dim intPart, intScore
        Dim intMonth, intDay, intYear
        Const DELIM = "/"
        Const YYWINDOW = 50

    Alle As String und As Integer deleted.

    Nächste fehler:

    Microsoft VBScript Compilation Error 800A0408
    linija 28, Error Invalid Character

    strPatternParts = Split(UCase$(DatePattern), DELIM)

    So ich habe "$" gelöscht, und dann habe ich diese Fehlermeldung bekommen:

    Microsoft VBScript Compilation Error 800A0046
    linija 14, Permision Denied

    Es ist nicht möglich weill ich habe voll Administrator-Rechte.

    Könnten Sie mir helfen, bitte!??

    Dienstag, 20. Dezember 2011 15:36
  • Hi,

    das hat so keinen Zweck. Du kannst nicht einfach VB[.NET] Code nehmen und dann denken, dass der in VBScript läuft. Das sind zwei(drei) komplett unterschiedliche Technologien.

    Konstanten in Methoden sind nicht sinnvoll, die solltest Du außerhalb der Methode deklarieren.

    Warum da jetzt irgendwelche Fehler kommen, kann man nur beantworten, wenn man deinen kompletten Code mal sehen würde, da man mit den Fragmenten nur wenig anfangen kann.

     


    Gruß, Stefan
    Microsoft MVP - Visual Developer ASP/ASP.NET
    http://www.asp-solutions.de/ - Consulting, Development
    http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
    Dienstag, 20. Dezember 2011 16:35
    Moderator
  • Hi Stefan,

    vielen Dank für deine Antwort. Diese Script ist über BackupCleanup (It deletes SharePoint backups that are older than a specified number of days and then removes the backups from the backup history). Alles hat super bis jetzt funktioniert und dann habe ich Problem wegen Amerikanisch / Europäische Datumeinstellungen.

    - Prioblemlösung zu finden, ich habe diese Function im Internet gefunden und dann auf meine *.vbs kopiert:

    Private Function ParseDate(ByVal DateString As String, _
                               ByVal DatePattern As String) As Date
        'DateString:  i/j/k formatting.
        'DatePattern: i/j/k formatting, each to be:
        '               M or MM for month position.
        '               D or DD for day position.
        '               YY or YYYY for year position, if YY
        '                 then century windowed at 50.
        Dim strStringParts() As String
        Dim strPatternParts() As String
        Dim intPart As Integer, intScore As Integer
        Dim intMonth As Integer, intDay As Integer, intYear As Integer
        Const DELIM As String = "/"
        Const YYWINDOW As Integer = 50

        strStringParts = Split(DateString, DELIM)
        strPatternParts = Split(UCase$(DatePattern), DELIM)
        For intPart = 0 To UBound(strStringParts)
            If intPart > UBound(strPatternParts) Then
                Err.Raise 5, "ParseDate"
            End If
            Select Case strPatternParts(intPart)
                Case "M", "MM"
                    intMonth = CInt(strStringParts(intPart))
                    intScore = intScore Or &H1
                Case "D", "DD"
                    intDay = CInt(strStringParts(intPart))
                    intScore = intScore Or &H2
                Case "YY"
                    intYear = CInt(strStringParts(intPart))
                    If 0 > intYear Or intYear > 99 Then
                        Err.Raise 5, "ParseDate"
                    End If
                    intYear = intYear + IIf(intYear < YYWINDOW, 2000, 1900)
                    intScore = intScore Or &H4
                Case "YYYY"
                    intYear = CInt(strStringParts(intPart))
                    If 100 > intYear Or intYear > 9999 Then
                        Err.Raise 5, "ParseDate"
                    End If
                    intScore = intScore Or &H4
                Case Else
                    Err.Raise 5, "ParseDate"
            End Select
        Next
        If intScore = &H7 Then
            ParseDate = DateSerial(intYear, intMonth, intDay)
        Else
            Err.Raise 5, "ParseDate"
        End If
    End Function

    - Linie, wo der Code ist inbegriffen:

    If ParseDate(left(objNode.SelectSingleNode("SPFinishTime").Text,10),"MM/DD/YYYY") < dtDeleteDate Then

    Kanntest du mir diese VB[.NET] in die VBScript änderen, bitte!??

    Mittwoch, 21. Dezember 2011 08:16