[stumped] VB: Argument not optional

Discussion in 'OT Technology' started by Astro, Jan 21, 2004.

  1. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    VB4 running on XP. That alone is probably a leathal combination. Here's the code its complaining about:

    Here's where I'm trying to get code from:
    http://archive.devx.com/free/tips/tipview.asp?content_id=4098

    Code:
    sconn = "DRIVER=Microsoft Excel Driver (*.xls);" & "DBO=" & sFile
    rs.Open "SELECT * FROM [sheetl$]", sconn
    
    I get the error and VB highlights: "rs.Open".

    I'm kinda stuck. Thoughts?
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    hmmm might be something with vb4 and it's compatability with Ado.

    have you tried declaring an actual connection object, opening it with your conn string, setting your recordset object like this set rs = ConnectionObj.Execute( "SELECT * FROM [sheet1$]" )
     
  3. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    No luck. I'm thinking its very possible its a reference problem (tools -> references). I had to add ActiveX as a reference to bypass some other errors.
     
  4. VBGOD

    VBGOD Guest

    It sounds like a DLL HELL compatability issue.
     
  5. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    I've tried it on my Win98 box and same error.
     
  6. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Quick thought: would a newer version of VB help? Seems like VB4 is not friendly to ADO. Friend of mine has VB6 at his office I may have a chance to play with in a few days. Would it be worth it? Or can I get away with DAO? - (I get the spelling on that right?)

    I'm not a VB coder. But if I can get this code to go, I can finish up this desktop app which a consulting company was supposed to do (yes, I'm attempting to bust my ass to score a few brownie points).
     
  7. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Special thanks to SLED for helping me over IM.

    Installed MDAC v2.8 and brute forced the recordset open method and finally got it to go.

    THANKS!
     
  8. you can definitely go DAO if you have too; I've developed/maintenanced DAO apps, and there's not a huge amount of difference, in my experience, in coding or capabilities.
     
  9. VBGOD

    VBGOD Guest

    SLED will do that. I heart his willingness to help. He's the best.
     
  10. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    :hug:

    :fawk:
     
  11. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    By yesterday afternoon, I had the core functionality working great (if this functionality didn't work, then the app was toast). By an hour after my usual shift I had dressed it up a little and did a little dog & pony show for my bosses. Then they gave me an update on the consulting firm that was supposed to build this app: they're still working on getting specs from Oracle. Today I think I'm going to work on a few minor bells and whistles to make the app a little more useful.

    Whew!

    If all goes well, I think there's another dog and pony show scheduled in two weeks for the users who will get to use this thing. What makes this kind of interesting is the marketing database group doesn't build apps (we end up reverse engineering the apps and figure out how to manipulate the data to our whims).
     

Share This Page