Results 1 to 10 of 10
  1. #1
    Join Date
    May 2005
    Posts
    13

    Unhappy Unanswered: Deployment issues, help



    I designed a DB in Access 2003. The file format is in Access 2000 format.


    I am using the following under the 'References' in VBA

    • Visual Basic for Applications
    • Microsoft Access 11.0 Object Library
    • OLE Automation
    • Microsoft DAO 3.6 Object Library
    • Microsoft ActiveX Data Objects 2.7 Library
    • Microsoft Windows Common Controls-2 (6.0) SP4


    I am finding out that when I open this DB up on computers with Access 2000, I keep getting an error or 'Method or Data member' not found on all of my Recordset objects and methods (e.g., RS!PRICE_CD trips the error, as well as RS.Fields("PRICE_CD")). The only thing missing on the references menu for the Access 2000 computers is obviously 'Microsoft Access 11.0 Object Library'. However, is there a way to switch this to version 9.0 (Access 2000)? VBA will not let me switch it (control in use).

    The DB uses ADO, and nothing else really special. Any ideas how I could get this to work?

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Are the recordsets explictly defined as ADODB.Recordset or DAO.Recordset? If not, now would be a good time to fix that...

    If you don't use DAO, you should remove the reference to the DAO library...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Don't change the Access ref library - Access will change that for you as long as your Access 2003 project is saved in Access 2000 format.

    With ADO versus DAO, if you don't explicitly declare the variable, Access will select the library it comes across first in the references list. In your Access 2K versions, the DAO is probably higher than ADO in the ref list.

    If you are not using DAO, remove it as Teddy suggested. You should always explicitly declare your variables, even if you do remove the DAO.

    Dim rsObject As ADODB.Recordset

    tc

  4. #4
    Join Date
    May 2005
    Posts
    13
    I have option explicit on, all my variables are declared.


    I'll try removing DAO since I am not using it.

    ....

    Tried removing it, I am still getting that error!! Are you sure it has nothing to do with Access Object 9.0 vs 11.0? This is an annoying error ><

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Option explicit will still let you do somethin like:

    dim rs As Recordset

    as opposed to

    Dim rs as ADODB.Recordset



    What do your recordset declarations look like?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    May 2005
    Posts
    13
    Quote Originally Posted by Teddy
    Option explicit will still let you do somethin like:

    dim rs As Recordset

    as opposed to

    Dim rs as ADODB.Recordset



    What do your recordset declarations look like?
    Here's the code:

    Code:
    Public Sub LoadSKUList(ViewMode As Integer, inList As ListBox)
    
    'On Error GoTo HandleError
    
    Dim conStr              As String
    Dim RS                  As ADODB.Recordset
    
    Set RS = New ADODB.Recordset
    
    
    If ViewMode = VIEWMODE_UNPROCESSED Then
    
        conStr = "SELECT SKU, DESC FROM [InputFile];"
        
        RS.Open conStr, Application.CurrentProject.Connection, adOpenStatic, adLockOptimistic
    
        Do While Not RS.EOF
    
            DoEvents
    
            inList.AddItem RS!SKU & " " & RS!DESC
    
            RS.MoveNext
        
        Loop
        
            
    Else
        
        conStr = "SELECT SKU, DESC FROM [ProcessedSKUs];"
        RS.Open conStr, Application.CurrentProject.Connection, adOpenStatic, adLockOptimistic
        
        Do While Not RS.EOF
    
            DoEvents
            inList.AddItem RS!SKU & " " & RS!DESC
            
            RS.MoveNext
        
        Loop
    End If
    
    RS.Close
    
    Set RS = Nothing
    
    HandleError:
    
    'MsgBox Err.Description, Err.Numb
        
        
        
        
        
        
        
        
    End Sub
    Last time I checked, RS was not a reserved word.

    The weird part is if I remove the RS!SKU lines (just comment them out), it loops through the whole recordset just fine. I'm so baffled...

    ANOTHER thing is that I am using Windows XP... I did not figure there would be a difference with Win2k. But all the Win2k systems I run it on I get that error, and all the XP systems I have tried to run it on do not get that error.
    Last edited by zerovector; 05-05-06 at 19:09.

  7. #7
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I'm not up on the "dot versus bang" discussions - I ALWAYS use dot unless there is not an option to.

    In any case, I have never used bang (!) with a recordset object

    if I remove the RS!SKU lines (just comment them out), it loops through the whole recordset just fine.
    Try RS("DESC") instead of RS!DESC

    tc

  8. #8
    Join Date
    May 2005
    Posts
    13
    I think I may have found the error..


    Access 2000 is erroring on inList.

    So I changed it to the actual list (forms!frmSelect!lstIncSKUs.Additem), but I keep getting an error on that... I wonder if there is a difference in the way the ListBox methods are between 03 VBA and 00 VBA?

  9. #9
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you have answered your own question .additem came in with A2k2 as far as i recall.

    ? can you use
    inList.rowsource = conStr
    and save the whole recordset exercise ?

    izy
    currently using SS 2008R2

  10. #10
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    all of which demostrates the wise rule of developing software on the lowest common platform, or at least testing on the lowest common platform before distribution.

    if you are developing in a mixed A2000, Office XP, A2003 then develop in A2000.

    In an ideal world test on every platform your application will run on before deployment

    failing that contact your hardware and software suppliers, get a commission ont he number of new PC's & software packages that are going to be required for your new app.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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