Displaying Recordset Line Number
I have a recordset that displays hundreds of records, I would like to display a row number next to each record in the order of 1, 2, 3 etc.
View RepliesI have a recordset that displays hundreds of records, I would like to display a row number next to each record in the order of 1, 2, 3 etc.
View Repliesive been looking on here for a while and i have to say what a great resource. i wondered if anyone could help me out with a slight problem ive stumbled across today in ssociation with line numbers?
im reading the contents of a text file into a variable, and using a regular expression to locate certain criteria, and the number of matches found (main reasoning for reg exps). but i also require the line numbers of each match from my search to take a copy of these lines contents. i think it could be a difficult one, i just wondered if anyone could help out or point me in the right direct?
I'm trying to find the line number of a specific piece of text:
do while textFileOpen.AtEndOfStream=false
if textFileOpen.ReadLine=text2Find then
foundAt=textFileOpen.Line
end if
Loop
But it keeps giving the wrong line number
What I'd like is foundAt to be 0 then if the line is found foundAt is to be the line number, if it is not found stay at 0
In the script above foundAt at increments even though the text isn't in the line?
I also get a "Input past end of file" if text2find isn't found
Is there a way to catch the line number of the error in production without
visual studio installed?
obs: Local I see the line number
I have a page that whenever an error occur, I send an email to support
with the error description, script name, server, referer, etc...
However, I want to add the line number to the email message. So far, I
have found that you would have to modify the custom error (500;100) on
the IIS to point to your own error page to be able to use the
Server.GetLastError object.
Does anyone know if there is a way out there that does not require
changing the IIS settings?
I am getting this error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'sid'
/beta/files/index.asp
There is no line number, and there is absolutely nothing on that page
using sid, and I mean not even a word, or even part of a word, in that
document or any of the include documents.
I have put the files from the production server back from the past
three days, and I am still getting this error.
It happened very suddenly, when I was made a change to a css file.
Yes, I know that CSS is client side and has no effect whatsoever on the
server, but there it is.
Does anyone have a clue about this? All the Googling has resulted in
errors with line numbers. Heck, if there were a line number, I
wouldn't be posting here - I'd fix it.
I'm developing a help desk system and i need to specify an ID for each call.
Using autonumber in Access i formated it ("NS"0000) to display NS0001 but
my ASP page only shows 01 when i display it.
I have a 5 digit account number, but I need only the first 2 digits of the number.
This shows the account number <%=rsSelSpecials("olaid")%>.
I have colums in my table named feature1, feature2, feature3, etc.... I would like to write them in my asp document with a line break in between them. I did this: Code:
View Replies View Relatedi want to show records from the database in such a manner that three records will show on on TABLE ROW. and then the next three on next table row and then next 3 on third table row. So nine records on one page. and there will be link for next link to move to next page.
I have some paging idea and i know how to move to next page but i dont know how to display records by limiting the columns of the rows. Like in the past i used to show all the records by either increasing the rows or by increasing the columns of the tables by using loop. but now i want to show records in such manner that limits both the rows and columns.
i have a set of details in the database that looks like this: Code:
Name Number
-------------------------
ABC 123456
ABC 128556
ABC 125559
DFF 559851
DFF 448715
DFF 154873
how do i select then in such a way that they are display like this on the asp page:
Code:
ABC
-------------------
123456
128556
125559
DFF
--------------------
559851
448715
154873
If I m using a simple code like this;
Set RS = Server.CreateObject("Adodb.Recordset")
strsql= "SELECT Images from product where status = 1 ORDER BY [Supplier]"
RS.Open strSql,Conn,3,3
If RS.RecordCount <> 0 then
While not RS.EOF
Images= RS("Images")
RS.MoveNext
WEND
RS.Close
While using this code "Images" is an array..(a collection of imagesname from the table "Product" whose status is 1). Now I have to use first 4 images at a time among these collection of Images in the different specific locations in a page in the same time.
Like Inshort (For example)....
How do I get the row number for a dataset? I'm trying to create loop that will get the information from that row print it and then move to the next row.
View Replies View RelatedI have a results table that is 5 columns wide. the recordset is returned with 48 items. I have no problem displaying 5 per row until I hit the last row where i get a ADODB.Field error '80020009'.Either BOF or EOF is True, or the current record has been deleted.Requested operation requires a current record.how do I close of the table row when I reach the EOF?
i.e
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 * *
I need to display empty cells (in place of the *'s)or end the row when there is no data to fill it...how is this done?
I am having a bit of trouble with classic asp and tables.
I want to loop through a recordset (easy enough) but I want to display the records in a table with only 3 records in a table row. So in other words each table row needs to have 3 items then a new table row is created dynamically until recordset.eof
Item 1 Item 2 Item 3
Item 4 Item 5.......until eof..
I tried the following code to save in a variable, the quantity of entries in my recordset:
if rsEntries.Supports(adApproxPosition) = true then
strCount = rsEntries.RecordCount
end if
It didn't work for me. It's returning a value of -1 and I have close to 100 entries in my recordset. Is there an alternative to this? What code can I use to accomplish that?
I want to display a series of records grouped by nested years and months, e.g.:
2004
December
Record1
Record2
Record3
November
Record4
Record5
...
...
2003
This would be based off of a date value stored with each item in the
recordset.
Does someone have a snip of nested looping script to break this down by
date in this manner? Code:
I had created a macro to read data from an excel sheet and write the values to a text file. I had used "ActiveSheet.Range("GB" & k).Value" command to read the values from the excel.some cells in the excel sheet is having two lines value and four lines data, the text file is generating that value in a single line. (Ex. the cell value in address column is in four lines and should display in four lines in the text file generated from the macro)
Can i do something in the excel sheet or in vb script to read the address value line by line and write line by line in text file?
I'm having trouble with the recordset object. I'm trying to use the "RecordCount" aspect of the recordset but it keeps diplaying "-1". How do I get it to show the total count of records?
View Replies View RelatedI have an encrypted .txt file created by asp. Its formatted with lines etc. Title followed by description underneath. I need to read this into ASP now, and parse it line by line. On each line read, run the function to unencrpt and add line to a new file.
Its the line by line Im having trouble with. If i do the full textstream no formatting takes place coz im adding the fulltextstream all in one addline call. How can I loop through lines ?
I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
View Replies View Relatedhere is the scenerio
in master batch table i have various master batch like
200701-0001
200701-0002
200701-0003
Now each master batch can have multiple final mixed batch like
200701-0001-01
200701-0001-02
200701-0001-03
and this record is inserted in to fmix table.
so i have a form in which i have a dropdown menu in which all the master batch is listed,
i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,
how to achieve this
so in short each master batch will have more than one final mixed batch.
pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.
I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.
How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?
Last week, my shopping cart was still working well until I began getting the following errors 2days ago..
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
../order/saveorder.asp, line 157
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Page:
GET /main/saveorder.asp
Could you check my code below and let me know what possibly the error is?
I have created a forum, in which I have 3 tables:
1: Table_Forum
2: Threads
3: Replies
I have it at the moment that on the main default.asp there is a recordset that will
display all records within that table, these are a list of forums that will be available.
I have a table that will show the forum name, and the description. This table is then looped using Do while not, now what i need to do is show how many records in the Treads table are related to each forum using asp. Code:
I have this textarea and I inputted this;
Quote: asp
xml
xhtml
If I update/save this to a database(msaccess) and view this in a browser it gives me a one line record like;
Quote: asp xml xhtml
but I dont want to put every end of the line a <br> tag for me not to view a one line record, how do I do this?
PHP has a function called nl2br() which inserts HTML line breaks before all newlines in a string. Is there an ASP equivalent to this?
View Replies View RelatedI've managed to code a function that will straightly replace some given character to another, for security of my pages. For example, I can convert (") to " and (') to ´ ..etc in the form(text field) that allow user to post some data to be stored in the db. But then I don't want the user to write it in HTML tag, and I want that when user press [Enter] on the keyboard, then I can redisplay the message in the way that the user really type in (new line). What I'm thinking is if I can replace the [ENTER] pressing to <br> to be stored in my db. But I didn't found the way I can do that.
/n such as in c++ didn't solve. Anybody knows? I use ASP VBscripts/
Does my question clear?
I have this small 4 line PHP code and I would really like this to work with ASP, can anyone dp this for me?Code:
<?php
$tempVar = 'http://www.temp.com';
$feed = file_get_contents($tempVar);
header('Content-type: text/xml');
echo $feed;
I am trying to trap my ASP errors using the ASP error object.
Everything works almost fine, but I can't retrieve the line number where
the error occured. Here is a little piece of my code:
==========================
If Err <> 0 Then
Response.Status = "500 Internal Server Error"
Response.Expires = 0
Dim ErrorContent
ErrorContent = ErrorContent & "Description: " & Err.Description & vblf
ErrorContent = ErrorContent & "Line: " & Err.Line & vblf
ErrorContent = ErrorContent & "Number: " & Err.Number & vblf
ErrorContent = ErrorContent & "Source: " & Err.Source & vblf
What does this line mean?
streamFile.SaveToFile m_sUploadFolder & fileItem.FileName, 2
in my textbody, i have several fields to send as an e-mail, but they would not fit into one row, how could put on the other line in the text body e-mails my other fields, thanks
#
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mail@mail.com"
myMail.To="mail@mail.org"
myMail.TextBody = "comment " & request.form("comment") & "; " & "city " & request.form("city")
myMail.Send
set myMail=nothing
/#
1. I have a form that insterts data in a database
2. I show this information in a pop-up page
3. When the user enter too much content it makes all the
pop-up too widther and it breaks the design.
I want determinate a specific number of caracters and then
do a line break.
I guess I need something like this:
replace(sql.field,char(10),'<br>')
in the way I show my content
like this:
<%=rs.fields("nombre").value%>
How can I do it?