473,511 Members | 16,730 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 (9876543210123456) becomes to 9.87654321012345E+15.
How can I make it display the original. Thanks

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

Ray at home

"atse" <du******@yahoo.com> wrote in message
news:ou********************@news02.bloor.is.net.ca ble.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 (9876543210123456) becomes to 9.87654321012345E+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.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:%2****************@TK2MSFTNGP12.phx.gbl...
How are you "selecting" it and "displaying" it?

Ray at home

"atse" <du******@yahoo.com> wrote in message
news:ou********************@news02.bloor.is.net.ca ble.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 (9876543210123456) becomes to

9.87654321012345E+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*******************@news04.bloor.is.net.cab le.rogers.com...
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:%2****************@TK2MSFTNGP12.phx.gbl...
How are you "selecting" it and "displaying" it?

Ray at home

"atse" <du******@yahoo.com> wrote in message
news:ou********************@news02.bloor.is.net.ca ble.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 (9876543210123456) becomes to

9.87654321012345E+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 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:e4**************@TK2MSFTNGP11.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*******************@news04.bloor.is.net.cab le.rogers.com...
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:%2****************@TK2MSFTNGP12.phx.gbl...
How are you "selecting" it and "displaying" it?

Ray at home

"atse" <du******@yahoo.com> wrote in message
news:ou********************@news02.bloor.is.net.ca ble.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 (9876543210123456) becomes to
9.87654321012345E+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.rogers.com...
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

Jul 19 '05 #6
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:uo**************@TK2MSFTNGP10.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.rogers.com...
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


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*********************@news01.bloor.is.net.c able.rogers.com...
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:uo**************@TK2MSFTNGP10.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.rogers.com...
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



Jul 19 '05 #8
' 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" <ms*****@ielearning.com> wrote in message
news:Oj**************@TK2MSFTNGP10.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*********************@news01.bloor.is.net.c able.rogers.com...
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:uo**************@TK2MSFTNGP10.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.rogers.com...
> 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



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*******************@news04.bloor.is.net.cab le.rogers.com...
' 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" <ms*****@ielearning.com> wrote in message
news:Oj**************@TK2MSFTNGP10.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*********************@news01.bloor.is.net.c able.rogers.com...
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:uo**************@TK2MSFTNGP10.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.rogers.com... > > 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
>
>



Jul 19 '05 #10
Yes, I agree that, but I don't get the driver either:(

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:ee**************@TK2MSFTNGP09.phx.gbl...
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*******************@news04.bloor.is.net.cab le.rogers.com...
' 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" <ms*****@ielearning.com> wrote in message
news:Oj**************@TK2MSFTNGP10.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*********************@news01.bloor.is.net.c able.rogers.com...
> 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:uo**************@TK2MSFTNGP10.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.rogers.com... > > > 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
> >
> >
>
>



Jul 19 '05 #11

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

Similar topics

21
42984
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...
7
5793
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...
25
2948
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...
4
1990
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...
23
5244
by: Davey | last post by:
How do I display an integer in binary format in C? e.g. 4 displayed as "100"
1
6056
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...
6
7333
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...
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?...
19
3567
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...
2
2195
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number?...
0
7138
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...
0
7355
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,...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5668
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,...
1
5066
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...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
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.