Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    Central Texas, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, folks!

    I'm trying to use a temporary recordset. Right now, it's in an Excel macro, but later I will probably make it a standalone VBS file, since I don't think I need anything Excel-specific, but I like using the Excel macro editor. I get the error "Object doesn't support this property or method" on the Append line. Can anyone tell me how to resolve this?

    Code:
    db = CreateObject("adodb.recordset")
    For a = 0 To 3
        db.Fields.Append SDF0(a), adVarChar, SDF3(a)
    Next a
    I get the same error as a VBS script runing under CSCRIPT.

    Thanks!

    --Scott.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    Scott

    Where are you retrieving the dataset from Excel, Access or another? Can you supply us with a little bit more of your code just to get a sampling.

    It also depends if you are binding early or late

    If you are binding early then:

    Dim db as ADODB.Recordset

    If late:

    Dim db as Object
    Set db = CreateObject("ADODB.Recordset")

    Will this help?
    Jerry

  3. #3
    New Lounger
    Join Date
    Dec 2009
    Location
    Central Texas, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jezza View Post
    Where are you retrieving the dataset from Excel, Access or another? Can you supply us with a little bit more of your code just to get a sampling.

    It also depends if you are binding early or late

    If you are binding early then:

    Dim db as ADODB.Recordset

    If late:

    Dim db as Object
    Set db = CreateObject("ADODB.Recordset")

    This particular one is an internally-created table, of which there are several. In other places I'll be parsing data from text files.
    When I use either of your suggestions, I got "Object variable or With block variable not set".

    However, while trying the changes, I realized that there was no SET in front of the CreateObject assignment, which turned out to be the problem, so it is now resolved.

    Thanks!

    --Scott.

Posting Permissions

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