Line Numbering On Writing Or Retrieving

I have two little programs, one which writes the name of a file into a log file when it is accessed by a visitor and the other to read the log file at any stage in its building. At either step, it would be useful to increment each line and see the number.

It would probably be easiest when reading the log file. I'm using: Set Txt = Sys.OpenTextFile( myCounterFile, 1 ) and then:
mytext=replace(Txt.ReadAll,vbcrlf,"<br>"). I'm guessing an incremented number goes in between but haven't been able to figure out the syntax or the modification. Also not sure if that "vbcrlf,"<br>" isn't redundant.

View Replies


ADVERTISEMENT

Writing/retrieving Variables From A Text File?

Does anyone know if it's possible to write and retrieve variables from a text file??

I know how to use the FSO to create text files and write data to them etc. I just don't know how to write a variable to a text file, and retrieve it at a later date??

I would like similar functionality to a cookie. The reason I can't just use a normal cookie is because the data needs to be permanent and I can't risk the cookies being removed off a users machine.

View Replies View Related

Writing From Same Line In FSO

I'm using the folowing code to search through a text file using FSO and only response.write the lines that start with "Flow": Code:

Do While f.AtEndOfStream = False
If left(f.Readline,4) = "Flow" Then
response.write f.ReadLine
End if
Loop

after I evaluate a line with the If statement it moves to the next line so I'm always writing the line after the one I want. How do I get away from this?

View Replies View Related

ASP: Writing A Line Break?

Am using ASP to email the contents of a form to myself and the customer. However, I've had an email from a customer saying that all the text in the email they received did not have any line breaks and all the lines ran into each other. I thought using the code "Chr(13)" would act as a line-break but it doesnt seem to. Code:

View Replies View Related

Writing In File Add Extra Line

I am writing one line and for a reason I ignore it adds a line which is screwing up a few things.

<%
Set fso = CreateObject("Scripting.FileSystemObject")
dim sLine sArchivo="switch.txt"
path = Server.MapPath("../Flash")
sFile = path & "" & sArchivo

if fso.FileExists(sFile) then
fso.DeleteFile(sFile)
end if
Set a = fso.CreateTextFile(sFile, True)
if request("radiobutton") = 1 then
sLine = "&ver=si"
else
sLine = "&ver=no"
end if

a.WriteLine (sLine)
a.Close

sRedirect="admin_NoticiasListado.asp?sRadio=" & request("radiobutton")
Response.Redirect(sRedirect)
%>

How come does the extra line come ? I seems I have done already a fews times and it never ocurred before.

View Replies View Related

Losing Line Breaks When Writing To MySQL Db

i have a MySQL database and i am using ASP

for one of my forms, i have a textarea form element that is...substantially large (500x300px) users are instructed to hit enter/return on their keyboard to separate paragraphs but i have encountered a problem.

in the textarea, everything is wonderful. line breaks are clearly seen...its awesome. when i submit the form and when it writes to the database (the field is set as 'text'), everything is crammed together...there is just one space between where one paragraph ends and another begins.

has anyone encountered this problem before? does anyone know a solution?

View Replies View Related

Numbering

Say I had a query which listed the below, from the database:

Fiesta
Citron
Metro
Skoda
Mondeo

How could I write something so that however many results are returned it automatically numbers them like this:

1 Fiesta
2 Citron
3 Metro
4 Skoda
5 Mondeo

So that no matter how many results came out it would just keep on numbering...?

View Replies View Related

Numbering With Asp

i need some one to help me how to do numbering with asp. for example if i want to display 10 titles in a page and the others shown on the next pages.i.e 1.2.3.4.5 etc.
thanks for quick response.

View Replies View Related

Numbering The Data

When you pull out some certain data from the DB, this is generally how it looks like in a table...
jill 123
jeff 444
alex 611
steve 244

But my question is that, how do you LIST the data beside them? its nothing to do with the table ID, its just when you pull the data out of the DB, you could use the ASP function ( I do believe there has to be one?) to number the data? This is how I mean...

1. jill 123
2. jeff 444
3. alex 611
4. steve 244

View Replies View Related

Auto Numbering

i am auto numbering with sql in asp. my auto code worked but i am restructing my tables and i came across my auto numbered fields. my question is when you use auto number does it give an default field length in mssql and if it dose how do you specifi how long you want the field to be.

here is a sinpit of my code for a table using auto numbering.

sqlStr = "CREATE TABLE Consumer(Con_id INT IDENTITY (1,1) NOT NULL PRIMARY KEY, "&_
"Con_Fname VarChar(25), "&_

View Replies View Related

Sequential Numbering Of Recordsets

I am trying to add in another column on the left of this table to retun a sequential counts as to how many records I have returned. Such as

1 Mike
2 Steve
3 Susan
4 Sarah
5 Emily

But I can't figure out how to do it. Code:

View Replies View Related

Auto Numbering (letter-number)

i want to make a data field with an auto numbering , but i exactly want is like this CT-1 , CT-2,CT-3 , the Ct letters must be before the autonumber , so its seems to me in that case i cant choose the dat field in my db as int and choose identity Yes cause the identity seed will be an integer only and no way to put with it a number.

so i want to make throw asp and put this datfield as a char so it can accept the(letter-number)value , so how can the asp make an autonumbering, and know what the lastnumber so it can add 1 to it.

View Replies View Related

Read Cell Data Line By Line From Excel

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?

View Replies View Related

Read Txt File Line By Line

I 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 ?

View Replies View Related

Retrieving

When a new record is inserted into access db it creates an id, how can I return this value for a record I have just created?

View Replies View Related

Retrieving Value

I have the following code in my form:

Response.Write("<form name='Testing'>");
Response.Write("<INPUT type=hidden id='Testing_txtbox'
name='Testing_txtbox' value='a simple test'>");
Response.Write("</form>");

If I type the following in the very next line, I get a value of
"undefined".

Response.Write("value="+Request.Form("Testing_txtbox"));

why this won't work. and how I can retrieve values of hidden controls via Server side code?

View Replies View Related

Retrieving XML DTD Doc

I have a DTD xml doc and need to read the data from it and display it using ASP.

View Replies View Related

Retrieving Name Tag From URL

I want to know if there is a way to retrieve the tag from the URL, I don't know if thats its name, so I'll just explain what it is:

showmsg.asp?FID=mn&ID=2467#2529

the tag, as I call it is what follows the # sign, the number 2529, in this case. so, is there a way I can retrieve the tag with ASP, by the request object, or any other way, any Ideas? Another thing I wanted to know, not related to this subject, is how do I change value of a textarea that is placed in another window with VBscript or JAVA. is it possible?

View Replies View Related

Retrieving Qty

I have three different tables I will be pulling stuff from: user_info, img_inv, activitylog:

user_info I will be using their ID and state
img_inv I will be using part number
activitylog I will be using part number and date

I'm trying to select the part number from the activities list and match it with the img_inv to make sure it still exist. If it exist I want it to do a total count of how many times it has been looked at by 7 states within a given quarter. Code:

View Replies View Related

Retrieving Cookie Value

I want to retrieve the value of a cookie to make a form a little more user friendly (our intranet is configured to set a cookie for User First Name, Last Name and Email when they log in)

Unfortunately I can't figure out how to retrieve the value of the cookie. I've been trying:

<%
Response.write Request.Cookies(UserLName)
%>

But it gives me an error - I used Checky to make sure the cookies are there and they do exist:

Name:mascot
Value: UserLName=Tarby

Can someone give me some advice?

View Replies View Related

Retrieving Values

i want some help in how to retrieve values from multiple selection listbox. i want the values retrived to be used in the search which i perform from the database. i m doing a search feature which u all often see in job search sites. so someone selects multiple cities to search in i want that to include that in my search query.

View Replies View Related

Retrieving Url Properties

Is there a way in asp to retrieve part of the URL and use it

say the url was

http://localhost/site/craig

is there anyway of retrieving the word craig so to use it in the page

This is because i could have other addresses that are for example

http://localhost/site/Jon

where i need to retrieve the word jon

View Replies View Related

Retrieving Values

I have a form that send values to a second page. i m trying to compare the values received from the form with other values retrieved from a database. so if a value already exists then an error message is displayed. in order to compare the values i need to print them on the second page but I m bit stuck with this. i used request.form("category") in order to retrieve the values from the form but it doesn t work.

View Replies View Related

Retrieving Time

I am trying to get a field populated in an oracle database with a time stamp of when a form is submitted.

I have found out that there is a table in Oracle called DUAL which holds the current date and time. At present i can populate the date when the form is submitted using objrs('sub_date')=date() but when i query the database the time element of the field sub_date, the time displayed is 00:00 which is the default time.

So can anyone give me any help in how i can capture the time. I know about select to_char(sub_date,'DD-MON-YYYY HH24:MI') which will bring up the time but i can seem to populate the field sub_date with the time.

View Replies View Related

Retrieving Page Name

I am trying to retrieve the page name. I know this is possible using Server Variable PATH_INFO. The problem I am having though is that when I get to a page in one of my subdirectories the subdirectory name is displayed.

Example: my page index.asp is in the the admin directory so the PATH_INFO displays as /admin/index.asp. How can I strip the page name out so I get index.asp. I cannot use the function Right() since the page name could be any length.

View Replies View Related

Retrieving Properties

How to retrieve "Last modified" & "FileName" from all files in a specific folder (called MyDocs) and display on the ASP page?

eg. (in MyDocs folder)
- MikesWork.doc
- MyResume.xls
- HouseExpenses.xls

Situation
Let's assume that i just modified MyResume.xls file and save it today(10/30/2003) on my computer, then i upload it into the internet. On my asp page, i want to show all files Filename (Last Modified) in MyDocs folder.
eg.
Your Documents
1. MikesWork.doc (last modified 10/24/2003)
2. MyResume.xls (last modified 10/30/2003)
3. HouseExpenses.xls (last modified 9/15/2003)

I know it has to do with fso or something close to it... but totally have no idea (zero) of its logic or how it works. Please help me by giving me with full example.

View Replies View Related

Storing And Retrieving UTF-8

I'm writing a vbscript application that reads UTF-8 XML containing Chinese
characters and stores the data in MySql 4.0.x.
Does anybody have any experience in this area with regarding codepage and
character sets? Ideally I want the scripts to be able to handle Standard
European characters and Chinese characters as well.
Are there any special considerations for using MySql/ODBC and ADO to get and
put the data.

View Replies View Related

Retrieving Files

Right I have my files going into the database, and once successfully uploaded, a user is shown a few bits of information in a table such as the primary key, name of file, its size and the content type.Now i want to create <a href> links on the homepage etc so that browsers/users can download these files one at a time. So when they click the link, the Save.Open or Cancel dialog box appears. Have been trying different things for few days now but finally thought I better ask for some help as Im gettin nowhere.

View Replies View Related

Retrieving A Zip File From A Url Using Asp

I have a zipfile that is created dynamically for me on a webserver. I have the url of the zip sent as a post value to an asp script on my website.

In my asp script I need to be able to retrieve the zip file so that i may extract content from it using an asp zip component. Any idea how to retrieve the file?

View Replies View Related

Retrieving 200 Characters

I have a SQL statement to retreive results based on keywords entered
I only want to show the first 200 characters of the field though, how would I modify this code to do just that?

SQL = SQL + " instr( 1, lcase( description ), lcase( '" + aKeywords(i) + "' ), 1 ) > 0"

I thought it would have been something like:

SQL = SQL + " (left(instr( 1, lcase( description ), lcase( '" + aKeywords(i) + "' ), 1 ), 200) > 0"

View Replies View Related

Retrieving User From Db

i have a checkout page which lists the user and what they have puchased. however, theres a problem with this page as I cant retrieve the user from both tables in my db, Customer & Corporate. The error message that I received is:

Microsoft VBScript compilation (0x800A03F4)
Expected 'If'
/shop/check_out.asp, line 412, column 3
End
--^

which refers to the red line in the code below: Code:

View Replies View Related

Retrieving Varable From ASP To ASP.

I have an .ASP page that comes up, and I am trying retrieve a variable from
the previous .ASP page. However none of the variables from the previous .ASP
page are available to the current .ASP page. There are three pages in this
chain.

1. NewUser.html
Information is input in this page, and posted to the next page using this
tag <form method="post" action="newUser_response.asp">.

2. NewUser_response.asp
Information is retrieved from the previous page using the
<%=request.form("strADLocation") %tag, and then posted to the next page
using the <form method="post" action="newUser.asp" This page is basically
just a confirmation page, and just displays the information from the
previous page, and sends it to the next page.

3. NewUser.asp
This page is supposed to retrieve all of the variables from the previous
..asp page using this syntax strADLocation = request.form("strADLocation"),
and create a user account, but none of the variables are available to the
script portion of this page from the previous .asp page

I had a similar problem when I was trying to make variables available to a
..asp page from a .html page, and later found out that I had to re-declare
the variables in the second page which was an .asp page using this syntax
strADLocation = request.form("strADLocation"). Everything worked great at
this point(HTML to .ASP). The problem I am having is that I added an
additional .ASP page(NewUser_response.asp) in the middle, and I can't seem
to retrieve the variables from the previous .asp page. Now the chain is HTML
to .ASP to .ASP. If Code:

View Replies View Related

Retrieving Dates

when i retrieving date the dates come out in american format

eg 01/28/2006

how do i get it so it come out in 31/01/2006 ?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved