+ Reply to Thread
Results 1 to 6 of 6

SQL Temp table in ado connection = Error Msg

  1. #1
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    SQL Temp table in ado connection = Error Msg

    Query compiles in sql just fine, but when I run the vba sub, I receive this error msg
    Run-time error '3704':
    Operation is not allowed when the object is closed
    And as you'll notice, I have included SET NOCOUNT ON in the sSQL string. Can anyone help me with this?



    Please Login or Register  to view this content.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SQL Temp table in ado connection = Error Msg

    Have you tried opening a connection object first, then executing the Set NoCount On and then opening your recordset?
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    Re: SQL Temp table in ado connection = Error Msg

    How would I specify the "Set NoCount On" in someplace other than the cmdline (or sSQL)

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SQL Temp table in ado connection = Error Msg

    Create a connection and then execute:
    Please Login or Register  to view this content.
    for example.

  5. #5
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    Re: SQL Temp table in ado connection = Error Msg

    Tried it, same error message except the cnn.execute line is highlighted

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SQL Temp table in ado connection = Error Msg

    Did you open a connection first? What code did you use?

+ 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