Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outputting results from a Moduel (Access2K, Win2K, Off2K)

    I have put together a somewhat complex module that outputs the results I need to the immediate window (using debug.print)

    How do I 'grab' the output to populate a query/table?

    TIA
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    Open a DAO (or ADO) recordset based on a table, and instead of using Debug.Print, add records to the recordset, using AddNew (and Update for a DAO recordset). You'd have to provide details if you want more specific help.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    hmmm... well, if i try one thing nothing really happens and if i try another i get 'object does not support this property or method.'

    so i must be getting close!

    perhaps you can point out something obvious here.
    <font face="Georgia">
    'open the recordset (that I have created)
    Set Result = CurrentDb.OpenRecordset("OrphanedComplainantRecord s", dbOpenDynaset)

    'try and load the value to the table
    If CompValue = 0 Then
    Result.AddNew
    End If
    </font face=georgia>
    This doesn't do anything but there's no error. Trying
    <font face="Georgia">
    Result![ComplainantID].AddNew
    </font face=georgia>
    gives me the property/method thingy.

    I am, for some reason, using DAO.

    Any ideas?
    <img src=/S/brainwash.gif border=0 alt=brainwash width=15 height=15>

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    Something like this:

    Set Result = CurrentDb.OpenRecordset("OrphanedComplainantRecord s", dbOpenDynaset)
    Result.AddNew
    Result!ComplainantID = ...
    Result!OtherFieldName = ...
    ' etc.
    Result.Update

    The ... should be replaced by the values bases on the results of your 'somewhat complex module'.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    thanks -- that did it. i'll need to run the code from ASP at some point but at least i'm on the way.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    If you need to do it from ASP, you may have to use ADO, which uses a recordset object, but the methods and properties are different and it is opened on a connection or a command object rather than on a database object.
    Charlotte

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    actually I may have been a bit confusing when I brought in ASP. What I meant to say is, 'I want to get the code to work natively in Access in a module and grab the results in ASP.' However, I am not sure how to do that (trigger an Access module to run in ASP). If this is going to be problematic I can just re-do the code completely in ASP but I was thinking, perhaps naively, doing the code in Access might yeild a higher performance. The code involves a series of nested loops.

    Does this make sense? Do you know how to invoke, trigger, run etc. an Access code module using ASP? Is there an appreciable performance gain vs doing the looping natively in ASP?

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    I don't think you'll be able to trigger anything from ASP. As far as I know, you embed the ADO code in the ASP pages to retrieve the data. If you have questions about ASP, you might want to post them in VB/VBA where several ASPers hang out.
    Charlotte

  9. #9
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    Charlotte is correct - you can't run access code in a web page - even DAPs run in a sort of ASP environment, but require special features only available in IE, and also require some office functions. When web pages work with Access databases, you really only have the Jet facilities available, and not the VBA environment or the forms/reports facilities. There are several tools available (including DAPs) if you want to do web database work - see the thread that begins with <post#=365232>post 365232</post#> for some of the options.
    Wendell

  10. #10
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outputting results from a Moduel (Access2K, Win2K, Off2K)

    Well I can easily do the same thing in ASP and that's what I'm going to end up doing. I thought it might be quicker to do it in Access but even if it is this sounds like more overhead than this fuzzy blonde brain wants to handle. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    I like ASP a LOT so there's not much pain going that route...

Posting Permissions

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