Announcement

Collapse
No announcement yet.

sql tools and blob fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    You can try casting the column as, say VARCHAR or VARCHAR2 (must be supported type on DBMS).... e.g.,
    Code:
    Select   CAST (pdf_data AS VARCHAR2)  AS The_Data From TableName where....
    Depending on the engine this essentially gets the DBMS to do the grunt work.

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #22
      I'm using LONGVARCHAR to store the data. The field is VARCHAR(max) in the DB. I'll have to research the CAST operator. Not sure how to cast it as VARCHAR(max)?

      Chrisopher method (SetLongData) works as well as the ADO method.

      I can use the ADO retrieve method just fine to retrieve it whether it was stored using the ADO store method or Christopher's ODBC code.



      Bob Mechler

      Comment


      • #23
        I can use the ADO retrieve method just fine to retrieve it whether it was stored using the ADO store method or Christopher's ODBC code
        It's happening.

        Someone is picking the right tools for the job without prejudice!

        Oh, Be still my heart!

        MCM
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #24
          Following up...

          This turned out to be a quirk in the SQL Express ODBC driver, which requires the un-binding of a long-data column before it can be read. Adding "SQL_UnbindCol 1" to Bob's program fixed the problem.

          (To be clear, SQL Express requires that long-data columns not be bound. SQL Tools automatically binds all of the columns of a result set, so the un-bind step must be added when using various versions of SQL Server, including SQL Express.)

          -- Eric Pearson, Perfect Sync, Inc.
          Last edited by Eric Pearson; 4 Aug 2009, 04:02 AM. Reason: clarification
          "Not my circus, not my monkeys."

          Comment


          • #25
            I appreciate Eric's tenacity with the problem. I can now save and retrieve PDF's using varchar(max) in SQL Express 2005. (Learned a lot in the process too.)

            I'd also like to thank Christopher Carrol for his help, as well as Jose's responses on his forum when I was working on the same issue with ADO.

            Bob Mechler

            Comment


            • #26
              Thanks Eric for that information regarding SQL Express. The code I posted above works for Access, but I did not want to install SQL Express to test it.

              Glad you have it working Bob.

              Comment

              Working...
              X