Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Saving Recordset to a stream

Saving Recordset to a stream

Scheduled Pinned Locked Moved Database
visual-studioquestioncsharpsysadminwindows-admin
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mysorian
    wrote on last edited by
    #1

    What is this error due to? Error Type: Provider (0x80030103) Can't save. set cn =Server.CreateObject("ADODB.Connection") cn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=pubs;Data Source=XPHTEK" set RS=Server.CreateObject("ADODB.RECORDSET") RS.Open "Select au_fname, phone, city from authors",cn RS.Save "C:\pubauthrs.xml",adPersistXML RS.Close cn.close ---------- Both ADO 2.5 and 2,6 referenced. IDE is Visual Studio 6.0 IIS 5.0

    D 1 Reply Last reply
    0
    • M mysorian

      What is this error due to? Error Type: Provider (0x80030103) Can't save. set cn =Server.CreateObject("ADODB.Connection") cn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=pubs;Data Source=XPHTEK" set RS=Server.CreateObject("ADODB.RECORDSET") RS.Open "Select au_fname, phone, city from authors",cn RS.Save "C:\pubauthrs.xml",adPersistXML RS.Close cn.close ---------- Both ADO 2.5 and 2,6 referenced. IDE is Visual Studio 6.0 IIS 5.0

      D Offline
      D Offline
      Dr_X
      wrote on last edited by
      #2

      Been a while since I have coding any ADO but at first glance I would say close the connection. Recode the above using disconnected recordsets and then try saving the recordset.

      set cn = Server.CreateObject("ADODB.Connection")
      set rs = Server.CreateObject("ADODB.RECORDSET")

      cn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=pubs;Data Source=XPHTEK"
      rs.CursorLocation = adUseClient
      rs.Open "Select au_fname, phone, city from authors", CN, adOpenDynamic, adLockBatchOptimistic, adCmdText
      rs.ActiveConnection = Nothing
      rs.Save "C:\pubauthrs.xml",adPersistXML
      rs.Close

      This was not tested but should work. Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

      M 1 Reply Last reply
      0
      • D Dr_X

        Been a while since I have coding any ADO but at first glance I would say close the connection. Recode the above using disconnected recordsets and then try saving the recordset.

        set cn = Server.CreateObject("ADODB.Connection")
        set rs = Server.CreateObject("ADODB.RECORDSET")

        cn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=pubs;Data Source=XPHTEK"
        rs.CursorLocation = adUseClient
        rs.Open "Select au_fname, phone, city from authors", CN, adOpenDynamic, adLockBatchOptimistic, adCmdText
        rs.ActiveConnection = Nothing
        rs.Save "C:\pubauthrs.xml",adPersistXML
        rs.Close

        This was not tested but should work. Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

        M Offline
        M Offline
        mysorian
        wrote on last edited by
        #3

        While the adUseClient does make it like a disconnected recordset, the program comes back with the same error. Search has yielded the following error type. C-coders may recognize what his implies. 0x80030103 (STG_E_CANTSAVE) --> 57 (IOError) Thanks

        D 1 Reply Last reply
        0
        • M mysorian

          While the adUseClient does make it like a disconnected recordset, the program comes back with the same error. Search has yielded the following error type. C-coders may recognize what his implies. 0x80030103 (STG_E_CANTSAVE) --> 57 (IOError) Thanks

          D Offline
          D Offline
          Dr_X
          wrote on last edited by
          #4

          Take a look at this link. http://www.webservertalk.com/archive126-2004-4-190097.html[^] Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

          M 1 Reply Last reply
          0
          • D Dr_X

            Take a look at this link. http://www.webservertalk.com/archive126-2004-4-190097.html[^] Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

            M Offline
            M Offline
            mysorian
            wrote on last edited by
            #5

            I thank you sincerely for your efforts. The code you sent me did not work, the same message. I played around with all kinds of permissions, nothing worked. Finally I nailed down to an MSDN article.... The real reson besides the 'bug' that microsfot has found is tht the earlier versions do not support xml to the extent the 2.8 does. --------------------- There is an explanation here. I have seen in Pre-MDAC2.8 books claims that the code works, I know not how it could have? It is exasperating to deal with something that does not work. Probably it is the 'race' to produce that is responsible for this irresponsible stuff. --------------------------------- SYMPTOMS When you try to save an ADO recordset to a file that was created by another user of the system, you may receive the following error message: Run-time error '-2147286781 (80030103)': Can't save. You receive this error message if the application is in a read-only folder, even if the recordset file is in a folder that has write permissions for both users. CAUSE When you try to save the recordset to a file that already exists, the recordset object creates a temporary file in the folder of the application. This folder is a read-only folder. Therefore, the second user cannot overwrite the source file. RESOLUTION This problem is resolved in Microsoft Data Access Components (MDAC) 2.8. In MDAC 2.8, the ADODB recordset creates the temporary file in the same folder as the destination file that was used to save the recordset. To download Microsoft Data Access Components (MDAC) 2.8, visit the following Microsoft Web site: Note Microsoft recommends that you test your application with MDAC 2.8 in a test environment first, to make sure that you are aware of any compatibility issues before you decide to use (or upgrade to) the MDAC 2.8 version. STATUS Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in MDAC 2.8. By the way, the preview of this message is not working.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups