473,486 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Display the serial number in asp file

17 New Member
Dear Friends,

Dealers details retreived from database and display in a asp file. I want to display the serial number. I don't know, how to display the serial number. anybody help me

Thanks
Suresh

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim db
  3. Dim rs
  4.  
  5. Set db=CreateObject("ADODB.Connection")
  6. Set rs=CreateObject("ADODB.Recordset")
  7.  
  8. db.Open "Driver={SQL Server};Server=Server;Database=TiAnode;Uid=sa;Pwd=;"
  9. rs.Open "select * from DEALERS order by DealerName", db
  10.  
  11. While not rs.EOF 
  12.     Response.Write ("<TABLE border=0 cellPadding=0 cellSpacing=0 width=580 align=center>")
  13.     Response.Write ("<TBODY>")
  14.     Response.Write ("<TR bgcolor=#F5F5F5>")
  15.  
  16.     Response.Write ("<TD width=35 class=contact align=center>")
  17.     Response.Write (1)
  18.     Response.Write ("</TD>")
  19.     Response.Write ("<TD width=375 class=contact>")
  20.     Response.Write (rs.Fields (1))
  21.     Response.Write ("</TD>")
  22.     Response.Write ("<TD width=130 class=contact>")
  23.     Response.Write (rs.Fields (3))
  24.     Response.Write ("</TD>")
  25.     Response.Write ("<TD width=50 class=contact>")
  26.     Response.Write ("rs.Fields (4)")
  27.     Response.Write ("</TD>")
  28.  
  29.     Response.Write ("</TR>")
  30.     Response.Write ("</TBODY>")
  31.     Response.Write ("</TABLE>")
  32.  
  33.     rs.MoveNext 
  34. Wend
  35. %>
Jul 2 '07 #1
2 1803
danp129
323 Recognized Expert Contributor
If you know the name of a field you can refer to it as rs("fieldname")

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim db
  3. Dim rs
  4.  
  5. Set db=CreateObject("ADODB.Connection")
  6. Set rs=CreateObject("ADODB.Recordset")
  7.  
  8. db.Open "Driver={SQL Server};Server=Server;Database=TiAnode;Uid=sa;Pwd= ;"
  9. rs.Open "select * from DEALERS order by DealerName", db
  10.  
  11. dim i
  12. While not rs.EOF 
  13.     i=i+1
  14.     Response.Write "<TABLE border=0 cellPadding=0 cellSpacing=0 width=580 align=center>"
  15.     Response.Write "<TBODY>"
  16.     Response.Write "<TR bgcolor=#F5F5F5>"
  17.     Response.Write "<TD width=35 class=contact align=center>" & i & "</TD>"
  18.     Response.Write "<TD width=375 class=contact>" &  rs("dealername") & "</TD>"
  19.     Response.Write "<TD width=130 class=contact>" & rs("city") & "</TD>"
  20.     Response.Write "<TD width=50 class=contact>" & rs("serial") & "</TD>"
  21.     Response.Write "</TR>"
  22.     Response.Write "</TBODY>"
  23.     Response.Write "</TABLE>"
  24.     rs.MoveNext 
  25. Wend
  26. %>
Jul 2 '07 #2
jhardman
3,406 Recognized Expert Specialist
If you don't know the field names, you can display it like this:
Expand|Select|Wrap|Line Numbers
  1. response.write "<table><tr>"
  2. for each x in rs.fields
  3.    response.write "<th>" & x.name & "</th>" & vbNewLine
  4. next
  5. response.write "</tr>"
  6. do until rs.eof
  7.    response.write "<tr>"
  8.  
  9.    for each x in rs.fields
  10.       response.write "<td>" & x.value & "</td>" & vbNewLine
  11.    next
  12.  
  13.    response.write "</tr>"
  14.    rs.moveNext
  15. loop
  16. response.write "</table>" & vbNewLine 
Jul 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2181
by: Polerio Babao Jr.II | last post by:
file fbus3.py resource shared by Chris Liechti <cliechti@gmx.net> during the conversation last september 2002. I made it available so that other user would benefit from it. I've used with...
5
2658
by: | last post by:
Hi, Do memory sticks have serial numbers like harddrives? If so how can I get this, I want to uniquely identify a memory stick (removable drive) for authentication. Thanks
21
3056
by: nephish | last post by:
i have an interesting project at work going on. here is the challenge. i am using the serial module to read data from a serial input. it comes in as a hex. i need to make it a binary and compare it...
3
3242
by: Stewart Allen | last post by:
Hi there I'm trying to find part serial numbers between 2 numbers. The user selects a part number from a combo box and then enters a range of serial numbers into 2 text boxes and the resulting...
14
28071
by: Lauren Wilson | last post by:
Discovered this interesting comment on MSDN: "To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI)...
1
1947
by: jaw_nee_g | last post by:
Hi, I'm new to Access and have what would seem to be a simple question: I'm looking to organize dates, tests, serial numbers and results. On some given date, a series of 16 tests are run on...
3
4794
by: bayazee | last post by:
Hi, How can I get CPU Serial number , or motherboard serial number with C . I need an idetification of a computer .... ThanX --------------------------------------------------- iranian python...
6
30679
by: Paul Bromley | last post by:
Ok - I have given up on trying to find the active IP address for a given PC. For licensing purposes I need to retrive a unique identifier from the PC that the program is installed on. The Hard disk...
2
3939
by: joaquimfpinto | last post by:
Dear All, I made an app in c# that uses several serial ports. For the serial ports I use a pnp Sunix board, some with 8 serial ports other with 4 or even 2 serial ports. Whenever I use the...
0
7099
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,...
0
7123
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,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
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
7319
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...
1
4864
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
4559
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...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.