Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2006, 02:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Auto generate no

hi,

can auto Generate number in asp file how ?

users have to fill Accident Report form,
many users fill the form, each form separate no.
when user open the asp, Form no generate and display in
asp page, so that user also know his form no.
and then insert his information

what coding use ?

Please help

Mateen


 
Old June 10th, 2006, 07:18 AM
Authorized User
 
Join Date: Jun 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default

Your looking for a random number generator? Where 6 is the uBound of the random number

<%

RANDOMIZE
Response.write(INT((6)*RND()))

%>

Earl
www.jhdesigninc.com



 
Old June 11th, 2006, 01:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for response

not Random number.

just like serial no. when user open the form it generate
form no.1, and after that next user open the form it
geneate form no.2 and so on.....
if one number generate, previous number should not the generate again.

regards.

Mateen
 
Old June 11th, 2006, 07:06 AM
Authorized User
 
Join Date: Jun 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default

Awwww I see so basically you want a counter, like a page counter that increments every time the page is open.

Make a file in note pad type 1 and save as Count_Me.cnt. This file will need write privlages

In the same directory as Count_Me.cnt make a page call test.asp. In test.asp put this code.

<%
varInOutFile = Server.MapPath("Count_Me.cnt")
Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set a = objFSO.OpenTextFile(varInOutFile)
    ct = CLng(a.ReadLine)
    ct = ct + 1
    Set a = objFSO.CreateTextFile(varInOutFile, True)
    a.WriteLine (ct) '--> increase the counter
    a.Close
Set a = Nothing
Set objFSO = Nothing
response.write ct 'This is your form number
%>

Earl
www.jhdesigninc.com






Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto generate get and set methods jdang67 .NET Framework 2.0 10 January 16th, 2008 08:20 AM
C# Auto Generate Codes lasith C# 0 February 23rd, 2007 02:25 AM
how to auto generate date? okboy SQL Server 2000 3 December 12th, 2006 08:17 PM
Auto generate? nikryden BOOK: Beginning VB.NET Databases 2 December 19th, 2005 12:43 PM
auto generate an number utarian Access 2 March 28th, 2005 02:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.