Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-07-2005, 01:24 PM   #1 (permalink)
In The Zone
 
whoopy_whale's Avatar
 
Join Date: Sep 2004
Location: Bermuda Triangle
Posts: 239
Default Random number in ASP


I tried to generate a random number using the following code.
Code:
set util=Server.CreateObject("MSWC.Tools")
num=abs(util.random)
But I get the following error.
Quote:
Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/jobinbasani123/picgallery.asp, line 14

Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
Is there any other method to generate a random number?
I have a database and the generated number should be less than or equal to the total number of the records in the database.

please help.....
__________________
In just two days, tomorrow will be yesterday.
whoopy_whale is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 08-07-2005, 12:28 AM   #2 (permalink)
In The Zone
 
Join Date: Jan 2004
Location: Panaji - Goa
Posts: 255
Default

Yeah there is a easy way to generate a random no.
Go thro my foll code and you can easily understand it.

Code:
<%
Dim Random_Number_Min, Random_Number_Max, Random_Number
Randomize
Random_Number_Min = 1
Random_Number_Max = 49
Random_Number = Int(((Random_Number_Max-Random_Number_Min+1) * Rnd) + Random_Number_Min)
Response.Write(Random_Number)
Response.Write("")
Response.Write("-")
Response.Write("")
%>
N pls switch to PHP. ASP n microsoft sux!

Njoy coding!
__________________
Ish Karo... Ishq karna Tumhara Paidaishi Haq Hai........
Magar Kyon Na Is Bar Watan Ki Mitti Ko Mashuka bana le!!!

:) http://www.aseemn.org
Aseem Nasnodkar is offline  
Old 08-07-2005, 11:26 AM   #3 (permalink)
In The Zone
 
whoopy_whale's Avatar
 
Join Date: Sep 2004
Location: Bermuda Triangle
Posts: 239
Default

Thanx Aseem,it works now....planning to move on to PHP.
__________________
In just two days, tomorrow will be yesterday.
whoopy_whale is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:58 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2