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
  1. Home
  2. General Programming
  3. C#
  4. Ace OLE driver with Extended Properties

Ace OLE driver with Extended Properties

Scheduled Pinned Locked Moved C#
questioncsharpcomwindows-adminxml
3 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.
  • A Offline
    A Offline
    Alaric_
    wrote on last edited by
    #1

    To cut to the chase, our current connection string is:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0 Xml;HDR=YES;'

    We really do not have the option of pushing a TypeGuessRows registry change to all users in order to force Excel to scan the whole column. Can TypeGuessRows be given as an extended property to the ACE Provider? Note: I know this isn't necessarily a C# specific question, but I'm writing in C# using an OleDbCommand, using the connectionString above.

    "I need build Skynet. Plz send code"

    D 1 Reply Last reply
    0
    • A Alaric_

      To cut to the chase, our current connection string is:

      Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0 Xml;HDR=YES;'

      We really do not have the option of pushing a TypeGuessRows registry change to all users in order to force Excel to scan the whole column. Can TypeGuessRows be given as an extended property to the ACE Provider? Note: I know this isn't necessarily a C# specific question, but I'm writing in C# using an OleDbCommand, using the connectionString above.

      "I need build Skynet. Plz send code"

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There's no way to force TypeGuessRows in the connection string to a different value. I think your only option is to append "IMEX=1" to the connection string, which forces Excel to read all column data as text only. You'll then have to parse out out values from the strings returned.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        There's no way to force TypeGuessRows in the connection string to a different value. I think your only option is to append "IMEX=1" to the connection string, which forces Excel to read all column data as text only. You'll then have to parse out out values from the strings returned.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        A Offline
        A Offline
        Alaric_
        wrote on last edited by
        #3

        btw, MS advised that the following should be correct:

        Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0 Xml;HDR=YES;Imex=1;ImportMixedTypes=Text;TypeGuessRows=0;

        "I need build Skynet. Plz send code"

        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