number to string

Discussion in 'ASP General' started by atse, Oct 5, 2003.

  1. atse

    atse Guest

    Hi,

    When I select a filed from a txt or csv file, and display on the ASP, the 16
    digit of barcode number (9876543210123456) becomes to 9.87654321012345E+15.
    How can I make it display the original. Thanks

    Atse
    atse, Oct 5, 2003
    #1
    1. Advertising

  2. atse

    Ray at Guest

    How are you "selecting" it and "displaying" it?

    Ray at home

    "atse" <> wrote in message
    news:eek:uMfb.102429$...
    > Hi,
    >
    > When I select a filed from a txt or csv file, and display on the ASP, the

    16
    > digit of barcode number (9876543210123456) becomes to

    9.87654321012345E+15.
    > How can I make it display the original. Thanks
    >
    > Atse
    >
    >
    Ray at, Oct 5, 2003
    #2
    1. Advertising

  3. atse

    atse Guest

    the source code
    <%
    ' pass the filename of a file located in C:\upload\
    file=Request.QueryString("file")

    con_xls="Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\upload\\test.xls;Extended
    Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
    set conn=server.CreateObject("ADODB.Connection")
    conn.open(con_xls)

    set rs = conn.execute ("select * from " & file)

    %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    <BODY>
    <table border=1>
    <%
    if not rs.eof then
    %>
    <% do until rs.EOF %>
    <tr>
    <%
    ' there are 16 columns in this file, but I don't know how to define a
    variable of the number of columns

    for i =0 to 15
    %>
    <td> <%= rs(i)%> </td>
    <%next%>
    </tr>
    <% rs.MoveNext
    loop

    end if
    %>
    </table>
    </BODY>
    </HTML>

    "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    news:%...
    > How are you "selecting" it and "displaying" it?
    >
    > Ray at home
    >
    > "atse" <> wrote in message
    > news:eek:uMfb.102429$...
    > > Hi,
    > >
    > > When I select a filed from a txt or csv file, and display on the ASP,

    the
    > 16
    > > digit of barcode number (9876543210123456) becomes to

    > 9.87654321012345E+15.
    > > How can I make it display the original. Thanks
    > >
    > > Atse
    > >
    > >

    >
    > >
    atse, Oct 6, 2003
    #3
  4. atse

    Ray at Guest

    It seems to me that the only way that you can get this to display directly
    from the RS the way you want is if you format the cell in Excel to display
    the number as text.

    Ray at home

    "atse" <> wrote in message
    news:lv2gb.34706$ko%...
    > the source code
    > <%
    > ' pass the filename of a file located in C:\upload\
    > file=Request.QueryString("file")
    >
    > con_xls="Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=C:\upload\\test.xls;Extended
    > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
    > set conn=server.CreateObject("ADODB.Connection")
    > conn.open(con_xls)
    >
    > set rs = conn.execute ("select * from " & file)
    >
    > %>
    > <HTML>
    > <HEAD>
    > <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    > </HEAD>
    > <BODY>
    > <table border=1>
    > <%
    > if not rs.eof then
    > %>
    > <% do until rs.EOF %>
    > <tr>
    > <%
    > ' there are 16 columns in this file, but I don't know how to define a
    > variable of the number of columns
    >
    > for i =0 to 15
    > %>
    > <td> <%= rs(i)%> </td>
    > <%next%>
    > </tr>
    > <% rs.MoveNext
    > loop
    >
    > end if
    > %>
    > </table>
    > </BODY>
    > </HTML>
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > news:%...
    > > How are you "selecting" it and "displaying" it?
    > >
    > > Ray at home
    > >
    > > "atse" <> wrote in message
    > > news:eek:uMfb.102429$...
    > > > Hi,
    > > >
    > > > When I select a filed from a txt or csv file, and display on the ASP,

    > the
    > > 16
    > > > digit of barcode number (9876543210123456) becomes to

    > > 9.87654321012345E+15.
    > > > How can I make it display the original. Thanks
    > > >
    > > > Atse
    > > >
    > > >

    > >
    > > >

    >
    >
    Ray at, Oct 6, 2003
    #4
  5. atse

    atse Guest

    I am now trying insert the csv file into the database, and I set this field
    as VARCHAR with length = 50
    but 9876543210123456 in the original file still displays
    9.87654321012345E+15 in the database, ASP,and the exported csv file.
    Any idea to solve this problem

    atse

    "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    news:...
    > It seems to me that the only way that you can get this to display directly
    > from the RS the way you want is if you format the cell in Excel to display
    > the number as text.
    >
    > Ray at home
    >
    > "atse" <> wrote in message
    > news:lv2gb.34706$ko%...
    > > the source code
    > > <%
    > > ' pass the filename of a file located in C:\upload\
    > > file=Request.QueryString("file")
    > >
    > > con_xls="Provider=Microsoft.Jet.OLEDB.4.0;Data
    > > Source=C:\upload\\test.xls;Extended
    > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
    > > set conn=server.CreateObject("ADODB.Connection")
    > > conn.open(con_xls)
    > >
    > > set rs = conn.execute ("select * from " & file)
    > >
    > > %>
    > > <HTML>
    > > <HEAD>
    > > <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    > > </HEAD>
    > > <BODY>
    > > <table border=1>
    > > <%
    > > if not rs.eof then
    > > %>
    > > <% do until rs.EOF %>
    > > <tr>
    > > <%
    > > ' there are 16 columns in this file, but I don't know how to define a
    > > variable of the number of columns
    > >
    > > for i =0 to 15
    > > %>
    > > <td> <%= rs(i)%> </td>
    > > <%next%>
    > > </tr>
    > > <% rs.MoveNext
    > > loop
    > >
    > > end if
    > > %>
    > > </table>
    > > </BODY>
    > > </HTML>
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > > news:%...
    > > > How are you "selecting" it and "displaying" it?
    > > >
    > > > Ray at home
    > > >
    > > > "atse" <> wrote in message
    > > > news:eek:uMfb.102429$...
    > > > > Hi,
    > > > >
    > > > > When I select a filed from a txt or csv file, and display on the

    ASP,
    > > the
    > > > 16
    > > > > digit of barcode number (9876543210123456) becomes to
    > > > 9.87654321012345E+15.
    > > > > How can I make it display the original. Thanks
    > > > >
    > > > > Atse
    > > > >
    > > > >
    > > >
    > > > >

    > >
    > >

    >
    >
    atse, Oct 6, 2003
    #5
  6. atse

    Ray at Guest

    What does it look like in the CSV file when you look at it in a text editor,
    such as notepad?

    Ray at home

    "atse" <> wrote in message
    news:wx5gb.234968$...
    > I am now trying insert the csv file into the database, and I set this

    field
    > as VARCHAR with length = 50
    > but 9876543210123456 in the original file still displays
    > 9.87654321012345E+15 in the database, ASP,and the exported csv file.
    > Any idea to solve this problem
    >
    > atse
    Ray at, Oct 6, 2003
    #6
  7. atse

    atse Guest

    The original one in Notepad is OK: 9876543210123456
    after inserted into the database, it looks like 9.87654321012345E+15 (I can
    view the record of database)

    The exported csv file in Notepad and Excel looks like 9.87654321012345E+15

    "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    news:...
    > What does it look like in the CSV file when you look at it in a text

    editor,
    > such as notepad?
    >
    > Ray at home
    >
    > "atse" <> wrote in message
    > news:wx5gb.234968$...
    > > I am now trying insert the csv file into the database, and I set this

    > field
    > > as VARCHAR with length = 50
    > > but 9876543210123456 in the original file still displays
    > > 9.87654321012345E+15 in the database, ASP,and the exported csv file.
    > > Any idea to solve this problem
    > >
    > > atse

    >
    >
    atse, Oct 6, 2003
    #7
  8. atse

    Mark Schupp Guest

    I came in late on this thread. What tool are you using to import the
    original CSV?

    If you are opening it with the MS Text drivers as a database you will need
    to include a column definition INI file to tell the drivers that the column
    is character data and not numeric (it should also be enclosed in quotes in
    the CSV file). Unfortunately I cannot remember the name that the INI file
    must use. Search through the documentation at Microsoft for the text
    drivers.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "atse" <> wrote in message
    news:aJigb.239433$...
    > The original one in Notepad is OK: 9876543210123456
    > after inserted into the database, it looks like 9.87654321012345E+15 (I

    can
    > view the record of database)
    >
    > The exported csv file in Notepad and Excel looks like 9.87654321012345E+15
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > news:...
    > > What does it look like in the CSV file when you look at it in a text

    > editor,
    > > such as notepad?
    > >
    > > Ray at home
    > >
    > > "atse" <> wrote in message
    > > news:wx5gb.234968$...
    > > > I am now trying insert the csv file into the database, and I set this

    > > field
    > > > as VARCHAR with length = 50
    > > > but 9876543210123456 in the original file still displays
    > > > 9.87654321012345E+15 in the database, ASP,and the exported csv file.
    > > > Any idea to solve this problem
    > > >
    > > > atse

    > >
    > >

    >
    >
    Mark Schupp, Oct 6, 2003
    #8
  9. atse

    atse Guest

    ' The text driver is:
    con_csv="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mypath\;Extended
    Properties=""text;HDR=No;FMT=Delimited"""
    set conn=server.CreateObject("ADODB.Connection")
    conn.open(con_csv)

    ' Because this is a csv file, I can only make a query string:
    set Rs=conn.execute("select * from thisfile.csv")

    ' Then I run a script to insert these records into the database.
    Unfortunately when this long number is inserted into the database, it
    changes to another format as text. How can I make this long number as text
    when inserting into the db? Thanks

    Atse


    "Mark Schupp" <> wrote in message
    news:...
    > I came in late on this thread. What tool are you using to import the
    > original CSV?
    >
    > If you are opening it with the MS Text drivers as a database you will need
    > to include a column definition INI file to tell the drivers that the

    column
    > is character data and not numeric (it should also be enclosed in quotes in
    > the CSV file). Unfortunately I cannot remember the name that the INI file
    > must use. Search through the documentation at Microsoft for the text
    > drivers.
    >
    > --
    > Mark Schupp
    > Head of Development
    > Integrity eLearning
    > www.ielearning.com
    >
    >
    > "atse" <> wrote in message
    > news:aJigb.239433$...
    > > The original one in Notepad is OK: 9876543210123456
    > > after inserted into the database, it looks like 9.87654321012345E+15 (I

    > can
    > > view the record of database)
    > >
    > > The exported csv file in Notepad and Excel looks like

    9.87654321012345E+15
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > > news:...
    > > > What does it look like in the CSV file when you look at it in a text

    > > editor,
    > > > such as notepad?
    > > >
    > > > Ray at home
    > > >
    > > > "atse" <> wrote in message
    > > > news:wx5gb.234968$...
    > > > > I am now trying insert the csv file into the database, and I set

    this
    > > > field
    > > > > as VARCHAR with length = 50
    > > > > but 9876543210123456 in the original file still displays
    > > > > 9.87654321012345E+15 in the database, ASP,and the exported csv file.
    > > > > Any idea to solve this problem
    > > > >
    > > > > atse
    > > >
    > > >

    > >
    > >

    >
    >
    atse, Oct 7, 2003
    #9
  10. atse

    Mark Schupp Guest

    There is a specially formatted INI file that you need to include in the same
    directory as the CSV file to tell the Jet text driver that the column in
    question is String instead of numeric. By default, the text driver "guesses"
    the data type based on the "typical" contents of the column. I cannot
    remember the name of the INI file but you should be able to find it in the
    Microsoft documentation for the desktop drivers (I have to search for it
    every time the subject comes up because I can never remember it).

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "atse" <> wrote in message
    news:pBmgb.42321$ko%...
    > ' The text driver is:
    > con_csv="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mypath\;Extended
    > Properties=""text;HDR=No;FMT=Delimited"""
    > set conn=server.CreateObject("ADODB.Connection")
    > conn.open(con_csv)
    >
    > ' Because this is a csv file, I can only make a query string:
    > set Rs=conn.execute("select * from thisfile.csv")
    >
    > ' Then I run a script to insert these records into the database.
    > Unfortunately when this long number is inserted into the database, it
    > changes to another format as text. How can I make this long number as text
    > when inserting into the db? Thanks
    >
    > Atse
    >
    >
    > "Mark Schupp" <> wrote in message
    > news:...
    > > I came in late on this thread. What tool are you using to import the
    > > original CSV?
    > >
    > > If you are opening it with the MS Text drivers as a database you will

    need
    > > to include a column definition INI file to tell the drivers that the

    > column
    > > is character data and not numeric (it should also be enclosed in quotes

    in
    > > the CSV file). Unfortunately I cannot remember the name that the INI

    file
    > > must use. Search through the documentation at Microsoft for the text
    > > drivers.
    > >
    > > --
    > > Mark Schupp
    > > Head of Development
    > > Integrity eLearning
    > > www.ielearning.com
    > >
    > >
    > > "atse" <> wrote in message
    > > news:aJigb.239433$...
    > > > The original one in Notepad is OK: 9876543210123456
    > > > after inserted into the database, it looks like 9.87654321012345E+15

    (I
    > > can
    > > > view the record of database)
    > > >
    > > > The exported csv file in Notepad and Excel looks like

    > 9.87654321012345E+15
    > > >
    > > > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in

    message
    > > > news:...
    > > > > What does it look like in the CSV file when you look at it in a text
    > > > editor,
    > > > > such as notepad?
    > > > >
    > > > > Ray at home
    > > > >
    > > > > "atse" <> wrote in message
    > > > >

    news:wx5gb.234968$...
    > > > > > I am now trying insert the csv file into the database, and I set

    > this
    > > > > field
    > > > > > as VARCHAR with length = 50
    > > > > > but 9876543210123456 in the original file still displays
    > > > > > 9.87654321012345E+15 in the database, ASP,and the exported csv

    file.
    > > > > > Any idea to solve this problem
    > > > > >
    > > > > > atse
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Mark Schupp, Oct 7, 2003
    #10
  11. atse

    atse Guest

    Yes, I agree that, but I don't get the driver either:(

    "Mark Schupp" <> wrote in message
    news:...
    > There is a specially formatted INI file that you need to include in the

    same
    > directory as the CSV file to tell the Jet text driver that the column in
    > question is String instead of numeric. By default, the text driver

    "guesses"
    > the data type based on the "typical" contents of the column. I cannot
    > remember the name of the INI file but you should be able to find it in the
    > Microsoft documentation for the desktop drivers (I have to search for it
    > every time the subject comes up because I can never remember it).
    >
    > --
    > Mark Schupp
    > Head of Development
    > Integrity eLearning
    > www.ielearning.com
    >
    >
    > "atse" <> wrote in message
    > news:pBmgb.42321$ko%...
    > > ' The text driver is:
    > > con_csv="Provider=Microsoft.Jet.OLEDB.4.0;Data

    Source=D:\mypath\;Extended
    > > Properties=""text;HDR=No;FMT=Delimited"""
    > > set conn=server.CreateObject("ADODB.Connection")
    > > conn.open(con_csv)
    > >
    > > ' Because this is a csv file, I can only make a query string:
    > > set Rs=conn.execute("select * from thisfile.csv")
    > >
    > > ' Then I run a script to insert these records into the database.
    > > Unfortunately when this long number is inserted into the database, it
    > > changes to another format as text. How can I make this long number as

    text
    > > when inserting into the db? Thanks
    > >
    > > Atse
    > >
    > >
    > > "Mark Schupp" <> wrote in message
    > > news:...
    > > > I came in late on this thread. What tool are you using to import the
    > > > original CSV?
    > > >
    > > > If you are opening it with the MS Text drivers as a database you will

    > need
    > > > to include a column definition INI file to tell the drivers that the

    > > column
    > > > is character data and not numeric (it should also be enclosed in

    quotes
    > in
    > > > the CSV file). Unfortunately I cannot remember the name that the INI

    > file
    > > > must use. Search through the documentation at Microsoft for the text
    > > > drivers.
    > > >
    > > > --
    > > > Mark Schupp
    > > > Head of Development
    > > > Integrity eLearning
    > > > www.ielearning.com
    > > >
    > > >
    > > > "atse" <> wrote in message
    > > > news:aJigb.239433$...
    > > > > The original one in Notepad is OK: 9876543210123456
    > > > > after inserted into the database, it looks like 9.87654321012345E+15

    > (I
    > > > can
    > > > > view the record of database)
    > > > >
    > > > > The exported csv file in Notepad and Excel looks like

    > > 9.87654321012345E+15
    > > > >
    > > > > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in

    > message
    > > > > news:...
    > > > > > What does it look like in the CSV file when you look at it in a

    text
    > > > > editor,
    > > > > > such as notepad?
    > > > > >
    > > > > > Ray at home
    > > > > >
    > > > > > "atse" <> wrote in message
    > > > > >

    > news:wx5gb.234968$...
    > > > > > > I am now trying insert the csv file into the database, and I set

    > > this
    > > > > > field
    > > > > > > as VARCHAR with length = 50
    > > > > > > but 9876543210123456 in the original file still displays
    > > > > > > 9.87654321012345E+15 in the database, ASP,and the exported csv

    > file.
    > > > > > > Any idea to solve this problem
    > > > > > >
    > > > > > > atse
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    atse, Oct 7, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    505
    Pete Becker
    May 21, 2005
  2. davidj411
    Replies:
    11
    Views:
    1,262
    Kam-Hung Soh
    May 29, 2008
  3. Ken Fine
    Replies:
    2
    Views:
    180
    Ken Fine
    Feb 5, 2004
  4. Jochen Brenzlinger
    Replies:
    5
    Views:
    667
    Daniel Pitts
    Nov 21, 2011
  5. Ferrous Cranus
    Replies:
    7
    Views:
    166
    Ferrous Cranus
    Jan 23, 2013
Loading...

Share This Page