Skip to main content

Search

Search

Serial Number With Letters And Numbers From Excel

Comments

4 comments

  • Avatar
    Legacy Poster
    It's the way Excel interprets and passes types of data. It's messed up, and has been like this for a long time. It almost always happens to me when, like you're describing, we're mixing data types.

    The best solution is to save your .xls out to a Tab Delimited .txt. There may be other workarounds, but that is the one I know works.

    From: http://www.seagullscientific.com/aspx/FAQ.aspx

    [i][b]When using Microsoft Excel as a database source for my BarTender label format, why do I often get missing data in some fields?[/b]
    A : This is a limitation of Excel, which is not a true database application. The data is dropped by the ODBC or OLEDB connection when the actual data in the field does not agree with the data type given to that field by the connection.

    The solution is either to export your data to a Microsoft Access database (.mdb file) using a delimited text file, or to "force" the data type used by the field by prefixing your data in Excel with a ' character. This forces the Excel ODBC/OLEDB driver to treat the data as string data type.[/i]
    0
  • Avatar
    Legacy Poster
    It was not just the information I wanted to hear :P
    I will find a way to force this thru.

    Thanks for your response nRyder
    0
  • Avatar
    Shotaro Ito
    This mixed type issue is long headache for Excel ODBC/OLEDB users.
    Generally use CSV database works well as nRyder suggested.
    If you need to stick with Excel,

    One solution is to unify column data type by apply "string" cell data type to excel sheet.
    However, Just applying string format to whole sheet doesn't change previously input values - you need to retype all data :(
    an easy way to retype all, is copy whole sheet, paste into notepad, apply string format to whole sheet, paste back from notepad.

    Another is specifying import mode (IMEX=1) allows OLEDB to read all mixed type column as text.
    ex..
    [code]objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Database2 & ";Extended Properties=""Excel 8.0;HDR=YES;IMEX=1"""[/code]

    Database connection created by BarTender 9.4 automatically add ";IMEX=1", to reduce the same thing to happen.

    Note that this scans only first 8 lines to determine mixed type column or not.
    0
  • Avatar
    Gene Henson
    I've attached a PDF here that helps explain the situation and workarounds.
    0

Please sign in to leave a comment.