CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    16

    Unhappy excel values become null [VS 2005]

    Hi all, I'm trying to import my xls files to sql server, but i saw some values become null even though data in excel values are exist.
    below is my connection string :
    Code:
            Dim cnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
            "Data Source=" & txtfName.Text & ";" & _
            "Extended Properties =""Excel 8.0;HDR=YES;IMEX=1"""
    i have searched many references about this topic, still no solution.
    I changed the registry editor HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel
    and set the TypeGuessRows become "0", still not give impact to my application.
    This error occurs while i'm importing the alphanumeric values into text, but previous values are numeric (but string datatyped).
    Any help appreciated!!
    THanks in advance

  2. #2
    Join Date
    Nov 2004
    Location
    LA. California Raiders #1 AKA: Gangsta Yoda™
    Posts
    616

    Re: excel values become null [VS 2005]

    Those are correct settings so it reads all rows for its guess at the data types.
    What version of Excel is the file? pre-2007 or 2007+?
    VB/Office Guru™ (AKA: Gangsta Yoda™)
    VB Forums - Super Moderator 2001-Present

    Microsoft MVP 2006-2011

    Please use [code]your code goes in here[/code] tags when posting code.

    Senior Software Engineer MCP, BSEE, CET
    VS 2012 Premium, VS 6.0 Enterprise SP6, VSTO, Office Ultimate 2010, Windows 7 Ultimate
    Star Wars Gangsta Rap SE Reputations & Rating Posts Office Primary Interop AssembliesAdvanced VB/Office Guru™ Word SpellChecker™.NETAdvanced VB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address ListVB6/Crystal Report Ex.VB6/CR Print Setup Dialog Ex.

  3. #3
    Join Date
    Sep 2009
    Posts
    16

    Re: excel values become null [VS 2005]

    the excel is pre 2007, but it doesnt work properly...i dont know why? i've searched many references about this, still i cant solve this problem..

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured