+ Reply to Thread
Results 1 to 5 of 5

Retrieve access data into excel

Hybrid View

hutty Retrieve access data into... 04-25-2007, 11:02 PM
rylo Hi Have you tried putting... 04-25-2007, 11:19 PM
hutty Yes. I have tried including... 04-26-2007, 08:34 AM
antoka05 I tried to use your code and... 04-26-2007, 10:01 AM
hutty ok.. i got it to work mostly.... 04-26-2007, 10:41 AM
  1. #1
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Have you tried putting the extra fields you require into the SQL string?

    stSQL = "select Name from Physicians where Code = " & ID & " "
    to (as an example)
    stSQL = "select Name, Address, Phone from Physicians where Code = " & ID & " "

    rylo

  2. #2
    Registered User
    Join Date
    04-25-2007
    Posts
    3
    Yes. I have tried including all the fields, but get an error Method "Execute" of Command Object failed on the following line.. 'Set rs = cmd.Execute()".

    I will need each field to go in a designated cell.

  3. #3
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I tried to use your code and it seems to run fine.

    Microsoft says the fast 'CopyFromRecordset' instruction will fail if the recordset
    contains an OLE object field or array data such as hierarchical recordsets.

    For more info: http://support.microsoft.com/kb/246335

    Regards,
    Antonio

  4. #4
    Registered User
    Join Date
    04-25-2007
    Posts
    3
    ok.. i got it to work mostly. The error pops up when I use a field in the select statement that has "NULL" for some of its data.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1