Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70

    Red face Unanswered: Compiler WRONG example-DB

    ******* COMPILER WRONG ********
    ========================
    !!!!! EXAMPLE FOR TEST !!!!!!!! Missing -->>>> ";User ID="
    Crazy-Errors (Unvisible strings) Run=YES, IMMEDIATE WINDOWN=NO
    -------------
    AC 2002, with usual references....
    download everywhere
    open DB with Admin
    open immediate window and type...
    ? CCC_STR(,eDB__DAT_DFT)

    Provider=Microsoft.Jet.OLEDB.4.0Admin;Password=;Je t OLEDBatabase Password=***;Data Source=D:\_MOJE\_APL\AC\BDB\DAT_DFT.MDB;Mode=16;Ex tended Properties="";Jet OLEDBystem database=D:\_MOJE\_APL\AC\BDB\xPAC_SYS0.MDW;Jet OLEDBatabase Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=1;Jet OLEDB:Global Bulk Transactions=1

    lcRet = "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    ---------------
    after compactrepair the same, allways.... !!!!
    Attached Files Attached Files
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  2. #2
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    references
    C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    C:\Program Files\Microsoft Office\Office10\MSACC.OLB
    C:\WINDOWS\system32\stdole2.tlb
    C:\Program Files\Common Files\system\ado\msado25.tlb
    C:\Program Files\Common Files\Microsoft Shared\Web Components\10\OWC10.DLL
    C:\Program Files\Common Files\System\ado\msadox.dll
    C:\Program Files\Common Files\System\ado\msjro.dll
    C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll
    C:\Program Files\Microsoft Office\Office10\EXCEL.EXE
    C:\WINDOWS\system32\MSCOMCTL.OCX
    C:\Program Files\Common Files\Microsoft Shared\Office10\MSO.DLL
    C:\WINDOWS\system32\scrrun.dll
    C:\WINDOWS\system32\FM20.DLL
    C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
    C:\Program Files\Microsoft Office\Office10\MSOUTL.OLB
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  3. #3
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    STEP-BY-STEP GUID

    open DB with Admin
    open immediate window and type...
    ? CCC_STR(,eDB__DAT_DFT)

    than cursor on function 'CCC_STR' and press SHIFT+F2 (Definition)
    Make a breakpoint at the start of 'CCC_STR'
    goto immediate window to line
    ? CCC_STR(,eDB__DAT_DFT) .. and <PRESS ENTER>
    Set NEXT STATEMENT to
    Code:
    lcRet = "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    Press F8 (STEP INTO)
    ----------- NOW Compare the Value of variable lcRet -----------
    goto immediate window and type
    Code:
    ? lcRet
    Provider=Microsoft.Jet.OLEDB.4.0Admin;
    Missing STRING: --->>> ";User ID="
    -----------------
    Now VERIFY Compiler lcRet = "Provider=" ....
    Code:
    ? "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;
    STRING is THERE : --->>> ";User ID="
    -----------------

    Any other questions ?
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Can anyone simplify wtf this topic is about? In simple English?

    "Compiler Wrong" == "I don't know what is going on or my database is corrupt".

    It's too easy to blame a compiler and if it truly is the compiler at fault, then there is nothing you can do about it, so what is the real problem here?!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Hi, sorry my native languague is not english...

    Compiler Wrong = < may be other words....>
    while running code (i would say compiled code, or VBE [running], ...)
    Code:
    Public Function CCC_STR(Optional cDataBaseFullName As String = vbNullString, Optional _
    ....
    lcRet = "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    ...
    the Value of Variable lcRet in Public Function CCC_STR is:
    ='Provider=Microsoft.Jet.OLEDB.4.0Admin;'
    Stop the Code, and verify the result value in Immediate window
    ='Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;'
    --------------------
    There is DIFFERENCE = ';User ID='....WHY ???
    The same line, TWO Results....
    ------------------
    Any other questions ?
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    According to your code, the lcRet variable is the concatenation of:

    1) a litteral string: "Provider="
    2) some variable gkDatabaseProvider that I suppose to be of type string and that should contain the Provider part in a connection string
    3) another litteral string: ";User ID="
    4) another variable, also presumably of type string and that identifies the User in a connection string
    5) another litteral string: ";"

    If you add everything together you obtain:
    Provider=<some provider>;User ID=<some user id>;
    and this is precisely what you can see in the immediate windows, so what's wrong?

    Sometimes, there is a big difference between what you believe a variable should contain and what it really does. In such a case trust the immediate window, not what you believe.

    Have a nice day!

  7. #7
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    and this is precisely what you can see in the immediate windows, so what's wrong?
    immediate window......is OK
    But you MUST COMPARE TWO VALUES
    ===============================
    Another one is this
    Set NEXT STATEMENT to
    Code:
    lcRet = "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    Press F8 (STEP INTO)
    ----------- NOW Compare the Value of variable lcRet -----------
    goto immediate window and type

    Code:
    ? ( lcRet = "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";")
    False
    ? lcRet
    Provider=Microsoft.Jet.OLEDB.4.0Admin;
    ? "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;
    Missing STRING: --->>> ";User ID="
    -----------------
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  8. #8
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I don't know which version of Access you are using nor how the variables are declared but I tested the bits of code you posted, using both string and variant variables just in case there could be a difference, though it is very unlikely.

    I tried my Test() function in Access 2000, Access 2003 and Access 2007, both in the French and in the English version of the Office Suite and, as I expected, always got the same results.

    Code:
    Function Test()
    
        Dim s_lcRet As String
        Dim s_gkDatabaseProvider As String
        Dim s_CurrentUser As String
        Dim v_lcRet As Variant
        Dim v_gkDatabaseProvider As Variant
        Dim v_CurrentUser As Variant
    
        s_gkDatabaseProvider = "Microsoft.Jet.OLEDB.4.0"
        s_CurrentUser = "SinnDHo"
        s_lcRet = "Provider=" & s_gkDatabaseProvider & ";User ID=" & s_CurrentUser & ";"
        Debug.Print "Using strings:"
        Debug.Print (s_lcRet = "Provider=" & s_gkDatabaseProvider & ";User ID=" & s_CurrentUser & ";")
        Debug.Print s_lcRet
        Debug.Print "Provider=" & s_gkDatabaseProvider & ";User ID=" & s_CurrentUser & ";"
        v_gkDatabaseProvider = "Microsoft.Jet.OLEDB.4.0"
        v_CurrentUser = "SinnDHo"
        v_lcRet = "Provider=" & v_gkDatabaseProvider & ";User ID=" & v_CurrentUser & ";"
        Debug.Print "Using Variants:"
        Debug.Print (v_lcRet = "Provider=" & v_gkDatabaseProvider & ";User ID=" & v_CurrentUser & ";")
        Debug.Print v_lcRet
        Debug.Print "Provider=" & v_gkDatabaseProvider & ";User ID=" & v_CurrentUser & ";"
    
    End Function
    Here are the results that appeared in the debug window (here from a French version, so "Vrai" stands for "True"):

    Using strings:
    Vrai
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=SinnDHo;
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=SinnDHo;
    Using Variants:
    Vrai
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=SinnDHo;
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=SinnDHo;
    If you get other results, something really strange is happening in your version of Access.

    Have a nice day!

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what is in gkDatabaseProvider.. is it possible that it contains non printable characters?

    what does
    ?"Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";")
    show?

    you need to track down the different elements and make sure they contain valid data and are what you expect

    its possible you may need to enclose the user id in quote " marks
    the currentuser is a function so I'd expect to see currentuser()

    it may make more sense to go back to where you got this code snippet from and ask that provider what you need to do.
    I'd rather be riding on the Tiger 800 or the Norton

  10. #10
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    1. healdem
    what is in gkDatabaseProvider.. is it possible that it contains non printable characters?

    Public Const gkDatabaseProvider As String = "Microsoft.Jet.OLEDB.4.0"
    Why Different results Code-Runnnig / Immediate window ?
    =============================================
    2. Sinndho
    I need Your FEEDBACK with **MY DB**...
    =================================
    yes you are right, my DB seems to be WRONG...
    But how Is it possible (Compiler wrong ?, or... )
    There is some Random WRONG-Proccess, i can repair it ,
    but it repeats allways...
    When i make the same in One Function DB ( as you have done) ...it is OK

    3.Sinndho , Access version
    Ac 2000,Ac 2002, Ac 2003..SP3, last update , all the same !!!!

    4.
    Possible i need someone who can test **my-DB background ** with C++
    Do you knwow someone ?

    5. The same also ONLY with
    C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    C:\Program Files\Microsoft Office\Office10\MSACC.OLB
    C:\Program Files\Common Files\system\ado\msado25.tlb
    C:\Program Files\Common Files\System\ado\msadox.dll
    C:\WINDOWS\system32\scrrun.dll
    C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  11. #11
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I have a copy of your sample database but I need to know how you call the offending function. What's the entry point in your code and what are the parameters used (if any)? Without that information I cannot perform any test.

    We could always test the back end database but I don't think it would make any difference, in C++ or in any other language. There is something wrong either with your code or with your version of Access ... or with how your version of Access handles your code.

    Have a nice day!

  12. #12
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Hi ,
    1. you can simply test just this one line....
    Code:
    ? ( lcRet = "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";")
    False
    ? lcRet
    Provider=Microsoft.Jet.OLEDB.4.0Admin;
    ? "Provider=" & gkDatabaseProvider & ";User ID=" & CurrentUser & ";"
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;
    2.
    Or Full function call
    ? CCC_STR(,eDB__DAT_DFT)

    3. Wrong access ?
    Ac 2000,Ac 2002,Ac 2003...All wrong
    It helps SOMETIMES Compact&Repair...
    I make dailly import into new One...,but problem persists...
    The Crazy errors, are in different code places, but i would say , some of there are High-sensibel
    This is only an strong modified Part/Exctract from my Full DB...
    It happens also in MDE, if MDE -OK,than they are stabil...
    I make now only daily little version changes in modules, --> therefore i need new version of MDE dailly
    I have an Night_MDE, run-15 Hours dailly...OK, but problem is to full Test it...
    ------
    I was on fully other machine
    my_Ar = array("a1","a2")
    Running: my_ar(1) =Nullstring
    Immediate window : my_ar(1) = "a2"
    ------
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  13. #13
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Sorry but it works as expected here (see attached file).

    Have a nice day!
    Attached Files Attached Files

  14. #14
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Hi Sinndho, THANKS for the Test .
    ==========================
    But there was inserted line.....True ?
    debug.Print lcRet
    (possible recompiled, Compile on demand On/Off ?,Background compile,...)

    I need to test only my DB, without any changes.-----------------------------------------------
    C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
    =6.05.1024
    C:\Program Files\Microsoft Office\Office10\MSACC.OLB
    =10.0.6308
    ------------------------------------------
    After recompile , the behaviour is fully other, te same by me, but there is NO GARANTEE , that they are NONE such errors in other place
    ------------------------------------------
    I try to REPEAT this Error-procces-behaviour,but it seems to be Random process...
    My testing, crash on this line and could not be repaired :
    lcRet = Chr$(42) & Chr$(42) & Chr$(42)
    It helps only importing into new one
    -----------------------------------------
    I am ready , to consult this also through Messenger, Skype...
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  15. #15
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Here is my screen shot , unbelievable Debug watch
    Access 2002 10.6771.6845 SP3
    Attached Files Attached Files
    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
  •