Results 1 to 5 of 5

Thread: CopyFromRecordset rs

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    36

    CopyFromRecordset rs

    Hello all I am trying to use the code CopyFromRecordset rs
    but i found that only i can run this while it's sitting on a network drive. I need to loop and return each record what can i use instead of CopyFromRecordset rs? here is what I have now...Thanks in advance

    For i = 1 To rs.Fields.Count

    xlWs.Cells(currentRow, i).Value = rs.Fields(i - 1).Name


    Next i

    currentRow = currentRow + 1

    'append recordset data to worksheet

    xlWs.Cells(currentRow, 1).CopyFromRecordset rs

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: CopyFromRecordset rs

    Quote Originally Posted by lisa1980
    but i found that only i can run this while it's sitting on a network drive.
    This is a first...what happens when you are not on a network drive?

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: CopyFromRecordset rs

    How are you populating your rs? when it doesnt work "locally" what error(s) do you receive?

    Maybe taking a look at my CopyFromRecordset FAQ example will shed some light on it?
    post #2 is VB6 example:
    http://www.vbforums.com/showthread.php?t=402060
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    36

    Re: CopyFromRecordset rs

    Thank you for responding... I thought by using the CopyFromRecordset would work fine and make the application run a bit faster(lots of data) but because my
    Colleague does not work in the same state i do that's is when i notice the issue. I looked at the code example and they all use the CopyFromRecordset.
    Any thoughts on this

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: CopyFromRecordset rs

    Both of you being far apart, how are you two connecting to the data? Logging on to a terminal server session or web page or ???
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width