473,594 Members | 3,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

number to string

Hi,

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

Atse
Jul 19 '05 #1
10 5790
How are you "selecting" it and "displaying " it?

Ray at home

"atse" <du******@yahoo .com> wrote in message
news:ou******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Hi,

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

Atse

Jul 19 '05 #2
the source code
<%
' pass the filename of a file located in C:\upload\
file=Request.Qu eryString("file ")

con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
Source=C:\uploa d\\test.xls;Ext ended
Properties=""Ex cel 8.0;HDR=Yes;IME X=1"""
set conn=server.Cre ateObject("ADOD B.Connection")
conn.open(con_x ls)

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

%>
<HTML>
<HEAD>
<META NAME="GENERATOR " Content="Micros oft 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:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
How are you "selecting" it and "displaying " it?

Ray at home

"atse" <du******@yahoo .com> wrote in message
news:ou******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Hi,

When I select a filed from a txt or csv file, and display on the ASP,
the 16
digit of barcode number (98765432101234 56) becomes to

9.8765432101234 5E+15.
How can I make it display the original. Thanks

Atse


Jul 19 '05 #3
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" <du******@yahoo .com> wrote in message
news:lv******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
the source code
<%
' pass the filename of a file located in C:\upload\
file=Request.Qu eryString("file ")

con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
Source=C:\uploa d\\test.xls;Ext ended
Properties=""Ex cel 8.0;HDR=Yes;IME X=1"""
set conn=server.Cre ateObject("ADOD B.Connection")
conn.open(con_x ls)

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

%>
<HTML>
<HEAD>
<META NAME="GENERATOR " Content="Micros oft 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:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
How are you "selecting" it and "displaying " it?

Ray at home

"atse" <du******@yahoo .com> wrote in message
news:ou******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Hi,

When I select a filed from a txt or csv file, and display on the ASP,

the
16
digit of barcode number (98765432101234 56) becomes to

9.8765432101234 5E+15.
How can I make it display the original. Thanks

Atse



Jul 19 '05 #4
I am now trying insert the csv file into the database, and I set this field
as VARCHAR with length = 50
but 987654321012345 6 in the original file still displays
9.8765432101234 5E+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:e4******** ******@TK2MSFTN GP11.phx.gbl...
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" <du******@yahoo .com> wrote in message
news:lv******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
the source code
<%
' pass the filename of a file located in C:\upload\
file=Request.Qu eryString("file ")

con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
Source=C:\uploa d\\test.xls;Ext ended
Properties=""Ex cel 8.0;HDR=Yes;IME X=1"""
set conn=server.Cre ateObject("ADOD B.Connection")
conn.open(con_x ls)

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

%>
<HTML>
<HEAD>
<META NAME="GENERATOR " Content="Micros oft 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:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
How are you "selecting" it and "displaying " it?

Ray at home

"atse" <du******@yahoo .com> wrote in message
news:ou******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
> Hi,
>
> When I select a filed from a txt or csv file, and display on the
ASP, the
16
> digit of barcode number (98765432101234 56) becomes to
9.8765432101234 5E+15.
> How can I make it display the original. Thanks
>
> Atse
>
>

>



Jul 19 '05 #5
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" <du******@yahoo .com> wrote in message
news:wx******** **************@ news01.bloor.is .net.cable.roge rs.com...
I am now trying insert the csv file into the database, and I set this field as VARCHAR with length = 50
but 987654321012345 6 in the original file still displays
9.8765432101234 5E+15 in the database, ASP,and the exported csv file.
Any idea to solve this problem

atse

Jul 19 '05 #6
The original one in Notepad is OK: 987654321012345 6
after inserted into the database, it looks like 9.8765432101234 5E+15 (I can
view the record of database)

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

"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
news:uo******** ******@TK2MSFTN GP10.phx.gbl...
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" <du******@yahoo .com> wrote in message
news:wx******** **************@ news01.bloor.is .net.cable.roge rs.com...
I am now trying insert the csv file into the database, and I set this

field
as VARCHAR with length = 50
but 987654321012345 6 in the original file still displays
9.8765432101234 5E+15 in the database, ASP,and the exported csv file.
Any idea to solve this problem

atse


Jul 19 '05 #7
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" <du******@yahoo .com> wrote in message
news:aJ******** *************@n ews01.bloor.is. net.cable.roger s.com...
The original one in Notepad is OK: 987654321012345 6
after inserted into the database, it looks like 9.8765432101234 5E+15 (I can view the record of database)

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

"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
news:uo******** ******@TK2MSFTN GP10.phx.gbl...
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" <du******@yahoo .com> wrote in message
news:wx******** **************@ news01.bloor.is .net.cable.roge rs.com...
I am now trying insert the csv file into the database, and I set this

field
as VARCHAR with length = 50
but 987654321012345 6 in the original file still displays
9.8765432101234 5E+15 in the database, ASP,and the exported csv file.
Any idea to solve this problem

atse



Jul 19 '05 #8
' The text driver is:
con_csv="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a Source=D:\mypat h\;Extended
Properties=""te xt;HDR=No;FMT=D elimited"""
set conn=server.Cre ateObject("ADOD B.Connection")
conn.open(con_c sv)

' 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" <ms*****@ielear ning.com> wrote in message
news:Oj******** ******@TK2MSFTN GP10.phx.gbl...
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" <du******@yahoo .com> wrote in message
news:aJ******** *************@n ews01.bloor.is. net.cable.roger s.com...
The original one in Notepad is OK: 987654321012345 6
after inserted into the database, it looks like 9.8765432101234 5E+15 (I

can
view the record of database)

The exported csv file in Notepad and Excel looks like 9.8765432101234 5E+15
"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
news:uo******** ******@TK2MSFTN GP10.phx.gbl...
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" <du******@yahoo .com> wrote in message
news:wx******** **************@ news01.bloor.is .net.cable.roge rs.com...
> I am now trying insert the csv file into the database, and I set this field
> as VARCHAR with length = 50
> but 987654321012345 6 in the original file still displays
> 9.8765432101234 5E+15 in the database, ASP,and the exported csv file.
> Any idea to solve this problem
>
> atse



Jul 19 '05 #9
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" <du******@yahoo .com> wrote in message
news:pB******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
' The text driver is:
con_csv="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a Source=D:\mypat h\;Extended
Properties=""te xt;HDR=No;FMT=D elimited"""
set conn=server.Cre ateObject("ADOD B.Connection")
conn.open(con_c sv)

' 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" <ms*****@ielear ning.com> wrote in message
news:Oj******** ******@TK2MSFTN GP10.phx.gbl...
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" <du******@yahoo .com> wrote in message
news:aJ******** *************@n ews01.bloor.is. net.cable.roger s.com...
The original one in Notepad is OK: 987654321012345 6
after inserted into the database, it looks like 9.8765432101234 5E+15 (I
can
view the record of database)

The exported csv file in Notepad and Excel looks like

9.8765432101234 5E+15
"Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in
message news:uo******** ******@TK2MSFTN GP10.phx.gbl...
> 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" <du******@yahoo .com> wrote in message
> news:wx******** **************@ news01.bloor.is .net.cable.roge rs.com... > > I am now trying insert the csv file into the database, and I set

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



Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
43009
by: Gavin | last post by:
Hi, I'm a newbie to programming of any kind. I have posted this to other groups in a hope to get a response from anyone. Can any one tell me how to make my VB program read the Bios serial number (or would HDD be better, or both?) and put that info into VB prog so the program won't work on another computer. My program uses an MSAccess table. Much appreciated if you can help! Thanks
7
5798
by: netclectic | last post by:
Hi folks, i've searched and searched and can't find any example of what i'm trying to do. Essentially (i think) i need to add a new operator to Number. I'm using eval to evaluate expressions that can be entered by users, these expressions are defined by another app so i can't change the format of the expressions. I've managed to support the majority of operators by supplying my own functions that wrap the equivalent Math functions but...
25
2966
by: Jason | last post by:
Hi, below is example code which demonstrates a problem I have encountered. When passing a number to a function I compare it with a string's size and then take certain actions, unfortunately during the testing of it I discovered that negative numbers were being treated as if they were > 0. I compiled the following on mingw compiler/dev c++/windows xp. If I replace string.size() for a ordinary number it behaves as expected? I notice...
4
2005
by: B. Fletcher | last post by:
Hi, I'm having some trouble with javascript code of mine: When the script runs, I vget an error in line 119: Number Expected. I'm not sure as to why this is happening. Any advice would be helpful. The source code is at the bottom of the post. Thankyou very much,
23
5263
by: Davey | last post by:
How do I display an integer in binary format in C? e.g. 4 displayed as "100"
1
6061
by: Andrew Arace | last post by:
I searched for something like this existing already, failing to find it, I wrote it myself. If this already existed somewhere in the framework I appologize for my ignorance. This method will take any number within the bounds of an int (int.MinValue - int.MaxValue) inclusive and converts it to an english number. For example, it will take "1" and give you "one", "2" yields "two", "-475918" give you a whopping "negative four hundred...
6
7351
by: Jovo Mirkovic | last post by:
Hi, I have to make a program which will generate 100,000 different ID numbers (for example 2345-9341-0903-3432-3432 ...) It must be really different, I meen it can not be a similar (like 2345-9341-0903-3432-343<b>1</b>) Does exist some algorithm for that... Thanks.
1
369
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number? ----------------------------------------------------------------------- Javascript variables are loosely typed: the conversion between a string and a number happens automatically. Since plus (+) is also used as in string concatenation, « '1' + 1 » is equal to « '11' »: the String deciding...
19
3587
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm starting a new one] I'd still like to finish this rounding mess. As a startup lemma we can take that VK is the worst programmer of all times and places: let's move from here forward please. The usability of any program depends on exact behavior...
2
2207
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number? ----------------------------------------------------------------------- Javascript variables are loosely typed: the conversion between a string and a number happens automatically. Since plus (+) is also used as in string concatenation, ` '1' + 1 ` is equal to ` '11' `: the String deciding...
0
7946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7877
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8253
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8240
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6661
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5411
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1482
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.