Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70

    Lightbulb Unanswered: Access 2003 Compiler WRONG...

    Hi, SOMETIMES happens this in my Access 2003
    The Value of second( index=1) item is Nullstring
    Code:
    Dim la As Variant 
    la = Array("MOD_ZZ7_BK1", "MOD_ZZ3_AC3",..., "CLS_ZZ1_MPK") 
     myString= la(1) ' value is "" ' required..."MOD_ZZ3_AC3" !!!, in immediate window  OK
    
    This happens in various code places. the compiler SKIPS some STRINGS...

    eMail: jan.pacala@zoznam.sk
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Obvious stuff - do you have "Option Explicit" declared at the top of the module? The code snippet you post is incomplete so I don't know if myString is declared.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Also, can you post EXACTLY your array declaration (expand on the "'..." bit). Unlikely to have an impact, but let's see.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Option Explicit = YES
    All is declared...
    Code:
    Dim cSQL$
    cSQL = "<some-text.1>" & _
    "<some-text.2>" & _
    "<some-text.3>"
    while running the code SOMETIMES happens this:
    cSQL = some-text.1 & some-text.3
    some-text.2...is MISSING !!!!

    In immediate window the same is O.K.
    This Crazy-thing occurs in different code places, ....
    Problem is some whole lines or some parts of lines are for the compiler NOT
    present....

    The same also on another computer
    I have tested my memory...O.K.
    Last Office update downloaded
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  5. #5
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    an example/screenshot:
    Access Compiler WRONG ( http://i41.tinypic.com/263xxfn.jpg )
    Problem: Compiler DO NOT see the Value of public constant gkII_cKRA_SKR,
    but the immediate window SEE IT.

    In this code part the problem was ALLWAYS exact on this constant gkII_cKRA_SKR.
    Code:
    public const gkII_cKRA_SKR$ = "LAB"
    ...
        If (Len(lc_TT_I0) > 0) And ((nI3_UPD_KUM = eI3_UPD_KUM_NONE) Or (nI3_UPD_KUM = eI3_UPD_KUM_INI)) Then
            cSQL = "SELECT " & EE_STR_ADD_TAB_TO_FLDs(LA_FLD_I3, "I3")
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cKRA_NZV: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cKRA_SKR: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cKRA_XXX: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cZP1: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cZP2: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cZP: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cZP_DATUM: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cKNR_LINKA: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cKNR2: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cIMG_DTM: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            If (LN_FLD_SEL_CNT < 255) Then cSQL = cSQL & ",I0." & gkII_cIMK_DTM: LN_FLD_SEL_CNT = LN_FLD_SEL_CNT + 1
            cSQL = cSQL & " " & "INTO [" & lcTab_OUT & "] IN '" & gkFile_Database_TMP_DFT & "' "
            cSQL = cSQL & " FROM [" & lc_tab_OUT_CUR & "] AS I3 "
            cSQL = cSQL & "INNER JOIN [" & lc_TT_I0 & "] AS I0 ON I3.[" & gkII_cKNR & "] = I0.[" & gkII_cKNR & "] ORDER BY I3.[SJ],I3.[KNR]; "
            GoSub F_EXEC_CMD0: bb = TT_LINK(lcTab_OUT): bb = TT_DEL0(lc_tab_OUT_CUR)
        End If
        If bI3_UPD_KUM Then
    ...
    Last edited by pacala_ba; 03-08-09 at 07:09.
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  6. #6
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Dim la As Variant ,la = Array("....Procedure code, see red mark down...
    Code:
    Public Sub BAK_ATR_SETUP()
    On Error GoTo xPAC_CHYBA: Dim lc__proc_meno$, lc__proc_ErrUSR$, ln__proc_err&
    Dim I&, I_MAX&, ll_OBJ_COM_5 As Boolean, ln_ObjType As AcObjectType, lc_DDF_EXP$, lc_DDF_1$
    Dim lc_DDF_3$, lc_DDF_7$, lc_DDF_9$, lc_DDF_ADM$, lc_DDF_FUL$, lc_MOD$, ll_RUN_REF_ADM As Boolean
    Dim lcVFYName$, lc_LIKE_F20$, lc_DDF_ATR$, ll_HOST_REF_001 As Boolean, ll_DEL_FRM20 As Boolean
    Dim myVBC As VBComponent, lc_FILE$, ln_LINE_CMD&, ll_RUN_ATR As Boolean, ln_BBO&, lc_DDF$
    Dim lc_PATH$, ll_CLR_oLL As Boolean, ll_SET_KUK As Boolean, ll_IMP_KUK As Boolean
    Dim ll_ADD_REF As Boolean, lc_FF_REF$, lc_FF_KUK$, la As Variant, lc_NAME$
    Dim ll_ASK As Boolean, ll_IS_ATR_000 As Boolean, lc_CNT_EXE_CUR$, i_r&
    Dim ln_BBA&, ll_MJK_REF As Boolean, ll_MJK_REF_ALL As Boolean, app As Access.Application
    Dim lc_CUR_APP_MDB$, LC_APP_PWD$, lc_CUR_APP_MDB_BAK$, lc_CUR_APP_MDB_LOG$, ln_BTN_DFT&
    Dim lc_CUR_PROJ_NAME$, lc_CUR_APP_MDB_EXE$, ll_REF_MDE As Boolean, lc_REF_EXT$
    lc__proc_meno$ = "BAK_ATR_SETUP"
    ...
    xPAC_KONIEC:
        Set myVBC = Nothing
        Set app = Nothing
    Exit Sub
    F_PREPARE_ATR:
    FF_PROTOKOL eFF_PROT_DEBUGGER, "F_PREPARE_ATR"
        ll_CLR_oLL = True
        la = AA_FROM_FRMS
        I_MAX = UB(la)
        ll_RUN_ATR = True
        For I = 0 To I_MAX
            lc_NAME = la(I)
            If Not (lc_NAME Like "FRM_ZZ1_B*") Or (lc_NAME Like "FRM_ZZ1_BBS*") Then
                DoCmd.DeleteObject acForm, lc_NAME
            End If
        Next I ' -end-line
        la = AA_FROM_RPTS
        I_MAX = UB(la)
        For I = 0 To I_MAX
            lc_NAME = la(I)
            DoCmd.DeleteObject acReport, lc_NAME
        Next I ' -end-line +++..........MOD_ZZ7_BK1
        la = Array("MOD_ZZ7_BK1", "MOD_ZZ3_AC3", "MOD_ZZ7_PRT", "MOD_ZZ3_BAS", "MOD_ZZ5_IN1", _
            "MOD_ZZ5_FR1", "MOD_ZZ7_SF1", "MOD_ZZ5_FR2", "MOD_ZZ9_BK2", _
            "MOD_ZZ9_EX1", "MOD_ZZ9_FX2", "CLS_ZZ1_EXT", "CLS_ZZ1_DLG", "CLS_ZZ1_MPK")
        I_MAX = UB(la) ' OFF.."MOD_ZZ2_EX2",... "CLS_ZZ1_DLG"
        For I = 0 To I_MAX
            lc_NAME = la(I) 
            DoCmd.DeleteObject acModule, lc_NAME ' Err: EMPTY-OBJECT-NAME
        Next I
        la = AA_FROM_MACS
        I_MAX = UB(la)
        For I = 0 To I_MAX
            lc_NAME = UCase$(la(I))
            If Not (lc_NAME Like "*EXEC*") Then
                DoCmd.DeleteObject acMacro, lc_NAME
            End If
        Next I
        lc_LIKE_F20 = "FRM_SEL*": ll_DEL_FRM20 = True
        DoCmd.DeleteObject acTable, gk_TT_SWITCHBOARD
    FF_PROTOKOL eFF_PROT_DEBUGGER, "return"
    Return
    F_DDF_REP:
    For i_r = 0 To 0
    bb = app.CompactRepair(lc_CUR_APP_MDB, lc_CUR_APP_MDB_BAK, True)
    bb = FF_RENAME(lc_CUR_APP_MDB_BAK, lc_CUR_APP_MDB)
    Next i_r
    Return
    F_PROJ_OPEN:
    FF_PROTOKOL eFF_PROT_DEBUGGER, "F_PROJ_OPEN"
    lc_CUR_APP_MDB_BAK = Replace(lc_CUR_APP_MDB, ".MDB", "_BAK.MDB")
    lc_CUR_APP_MDB_LOG = Replace(lc_CUR_APP_MDB, ".MDB", "_BAK.LOG")
    lc_CUR_APP_MDB_EXE = Replace(lc_CUR_APP_MDB, ".MDB", ".MDE")
    WW_SET_ForeGWIN app.hWndAccessApp
    GoSub F_DDF_REP
    app.OpenCurrentDatabase lc_CUR_APP_MDB, EXCLUSIVE:=True, BSTRPASSWORD:=LC_APP_PWD
    lc_CUR_PROJ_NAME = LEFT$(app.CurrentProject.Name, 12)
    app.VBE.ActiveVBProject.Name = lc_CUR_PROJ_NAME
    FF_PROTOKOL eFF_PROT_DEBUGGER, "return"
    Return
    F_PROJ_CREATE:
    FF_PROTOKOL eFF_PROT_DEBUGGER, "F_PROJ_CREATE"
    If ll_IS_ATR_000 Then
        '..If app.OBJECT_IS(acMacro, "__AutoExec") Then
            app.DoCmd.Rename "AutoExec", acMacro, "__AutoExec"
        'End If
    End If
    app.DoCmd.RunCommand acCmdCompileAndSaveAllModules
    app.CloseCurrentDatabase
    bb = FF_DEL(lc_CUR_APP_MDB_LOG)
    bb = FF_DEL(lc_CUR_APP_MDB_EXE)
    bb = FF_DEL(lc_CUR_APP_MDB_BAK)
    Debug.Print lc_CUR_APP_MDB
    ' OFF......GoSub F_DDF_REP
    Debug.Print bb & ", CompactRepair-1"
    If Not bb Then GoTo xPAC_KONIEC
    Debug.Print (Len(Dir$(lc_CUR_APP_MDB_LOG)) = 0) & ", CompactRepair-2" & ", " & lc_CUR_APP_MDB_LOG
    If ll_IS_ATR_000 Then
        WWW lc_CUR_APP_MDB_LOG
    Else
        BBM lc_CUR_APP_MDB_LOG, vbExclamation, lc__proc_meno, bDummy:=Not FF_EXISTS(lc_CUR_APP_MDB_LOG)
    End If
    If ll_REF_MDE Then
        app.SysCmd 603, lc_CUR_APP_MDB, lc_CUR_APP_MDB_EXE
        Debug.Print (Len(Dir$(lc_CUR_APP_MDB_EXE)) > 0) & ", MDE, " & lc_CUR_APP_MDB_EXE
        bb = FF_EXISTS(lc_CUR_APP_MDB_EXE, bMsgNotExists:=True)
    End If
    FF_PROTOKOL eFF_PROT_DEBUGGER, "return"
    Return
    ''F_SET_ATR:
    ''lcVFYName = CurrentProject.AllModules(lc_MOD).Name
    ''If Len(lcVFYName) > 0 The.n
    ''    DoCmd.OpenModule lc_MOD: bb = Application.Modules(lc_MOD).Find("#Const  gflgCompileATR = False", ln_LINE_CMD, 1, ln_LINE_CMD, 100)
    ''    If bb The.n Application.Modules(lc_MOD).ReplaceLine ln_LINE_CMD, "#Const  gflgCompileATR = true"
    ''End If
    ''Return
    F_DDF_EXP_CREATE:
    FF_PROTOKOL eFF_PROT_DEBUGGER, "F_DDF_EXP_CREATE"
    bb = FF_COPY(gkPath_DATABASE_DFT & "xPAC_DFT_NEW.mdb", lc_DDF)
    ' OFF...bb = DDF_CREATE(cDataBaseFullName:=lc_DDF, bProtectDB:=True)
    FF_PROTOKOL eFF_PROT_DEBUGGER, "return"
    Return
    F_MJK_EXP:
        I_MAX = UB(la)
        For I = 0 To I_MAX
            lc_NAME = la(I)
            FF_PROTOKOL eFF_PROT_DEBUGGER, "F_MJK_EXP"
        lc_DDF_EXP = ""
        If (lc_NAME Like "*_ZZ[01]_*") Then
            lc_DDF_EXP = lc_DDF_1
        End If
        ll_OBJ_COM_5 = ((StrComp("MOD_ZZ5_000", lc_NAME, vbTextCompare) = 0) Or _
            (StrComp("FRM_ZZ5_KSX", lc_NAME, vbTextCompare) = 0))
        If (lc_NAME Like "*_ZZ[3]_*") Then
            lc_DDF_EXP = lc_DDF_3
        End If
        If (lc_NAME Like "*_ZZ[5]_*") Then
            lc_DDF_EXP = lc_DDF_ADM
        End If
        If (lc_NAME Like "*_ZZ[79]_*") Then ' 7+9
            lc_DDF_EXP = lc_DDF_7
        End If
        If (lc_NAME Like "*_ZZ[9]_*") Then ' 9
            ' OFF...lc_DDF_EXP = lc_DDF_9
        End If
        If ln_ObjType = acMacro Or ln_ObjType = acTable Then
            lc_DDF_EXP = lc_DDF_ADM
        End If
        If (Len(lc_DDF_EXP) > 0) Then
            DoCmd.TransferDatabase acExport, "Microsoft Access", lc_DDF_EXP, _
                ln_ObjType, lc_NAME, lc_NAME
        End If
        If ll_OBJ_COM_5 Then
            lc_DDF_EXP = lc_DDF_7
            If (Len(lc_DDF_EXP) > 0) Then
                DoCmd.TransferDatabase acExport, "Microsoft Access", lc_DDF_EXP, _
                    ln_ObjType, lc_NAME, lc_NAME
            End If
        End If
        If ll_OBJ_COM_5 Then
            lc_DDF_EXP = lc_DDF_9
            If (Len(lc_DDF_EXP) > 0) Then
                DoCmd.TransferDatabase acExport, "Microsoft Access", lc_DDF_EXP, _
                    ln_ObjType, lc_NAME, lc_NAME
            End If
        End If
        Next I
        FF_PROTOKOL eFF_PROT_DEBUGGER, "return"
    Return
    F_DEL_FILE:
        bb = FF_DEL(lc_FILE & ".MDE"): bb = FF_DEL(lc_FILE & ".ZIP")
    Return
    F_DEL_FRM20:
        For Each myVBC In Application.VBE.ActiveVBProject.VBComponents
            If (myVBC.Name Like lc_LIKE_F20) Then
                Application.VBE.ActiveVBProject.VBComponents.Remove myVBC
            End If
        Next myVBC
    Return
    xPAC_CHYBA:
        If (Err = 2467) Or (Err = 7874) Then
            Resume Next ' CurrentProject.AllModules(lc_MOD).Name
        End If
        ln__ErrNumber& = Err.Number
    lc__ErrorDescription$ = Err.Description
    lc__ErrorSource = Err.Source
    ln__ErrDLLNumber& = Err.LastDllError
    ln__proc_err& = ERROR_SHOW(ln__ErrNumber&, lc__ErrorDescription$, _
        lc__ErrorSource$, ln__ErrDLLNumber&, lc__proc_meno$, lc__proc_ErrUSR$, lkCurModul_NV)
        Select Case ln__proc_err
        Case 1
    Resume
        Case 2
    Resume Next
        Case Else
    Resume xPAC_KONIEC
        End Select
    End Sub
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •