Generate Randomize Number
i trying to generate randomize number between in the range of 1 to 9999 using the below code. DNum* is between 1 - 9
RandValue = CLng((2^7*(ID1Num1))+(2^6*(ID1Num2))+(2^5*(ID1Num3 ))+(2^4*(ID1Num4))+(2^3*(ID1Num5))+(2^2*(ID1Num6)) +(2^1*(ID1Num7))+min1+min2+sec1+sec2)
then i put the randvalue where is usually generate number between 400-to-1500 into the below formula, any suggestion on how to improve the below code?
num_pmax = Int((9999 * Rnd) + 1)
num_pmin=1
value1 = Int((Num_pmax-Num_pmin+1)*Rnd+Num_pmin + RandValue)
View Replies
ADVERTISEMENT
i trying to randomize a string of text inc. number and alpha. e.g. 024053J
what is the approach to generate a few integer numbers from this string "024053J" ?
i tried to this way of randomize but not very efficient as in sometimes the user will get the same numbers back when the page is refresh.
So i thought to use a string of text to generate the randomize numbers.
randomize()
num_pmax=100
num_pmin=1
r2=Int((num_pmax-num_pmin+1)*rnd+num_pmin)
View Replies
View Related
I want to prepopulate a ticket number in my form, like when user enters the form the field ticket Id should always be filled with a number. I want to start my number with 1000.
View Replies
View Related
do anybody know how to write a code to increment id number in the text field once the "New" button is clicked in the form. Code:
View Replies
View Related
I want to display a random banner from a selection of 5 banners. So if number = 1 then display baner 1 etc. My code is as follows:
bannerCount = bannerRecordSet.RecordCount
Dim bannerSelected
Randomize
bannerSelected = Int(Rnd * bannerCount)
The above code works although it never seems to generate the value 1, ie 2-5. Also when I refresh the page sometimes a random banner is displayed and other times I get an error. Is this because I am generating a value outside 1-5? Code:
View Replies
View Related
I want a sample code for developing an " auto genearte number " and want to store in database.
View Replies
View Related
I am creating a Change Management system and need my ASP script to be able to generate a number as an incident number for example for me automatically. The number would be stored in a MySQL database and the language I am using is ASP.
Can I create a column in the database that is a Primary Key and is auto_increment, even if I have already got another coulumn that is the ID column, which is a primary key?
View Replies
View Related
I know this is not a php forum, but i've been given a task to create a form that requires a unique number every time the form is loaded. The form has been created but they have php on their site. windows would be in 3 weeks time but they want the form asap. The field is a hidden field since i've never looked at a php code page b4 i need some help.
View Replies
View Related
I was asked to create a test with 50 questions using MS Access (that's all we can afford). All question will load then show in random order (no duplicates, plus a link for the next question) then provide a "Thank you!" page at the end. This is so even when two people take the test they will have all 50 questions but each in a different order.
I've found several samples, some would let display the questions but in the same order everytime, while others would randomize them but with duplicates and I would'nt know when I got to the end because it would keep randomizing all day long.
View Replies
View Related
how can i randomize pages ?
Eg. when a user login and he click on a link, he will come to a start page(start.asp) and when he click on the button continue (take_test.asp), he will get the randomized page (question_1.asp or question_4.asp...question_3.asp etc)
View Replies
View Related
I am veiwing a set of records from Microsoft Access in asp. The records are in alphabetical order but I would like them to be randomized.
This is my code as it is at the moment. The Database is called tourguides.mdb and the table is called Cat1. I hope this is enough information. Code:
View Replies
View Related
I'm using a randomize function to display a different featured product, but there are certain items that I want to omit. Here's the code I'm using:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/theDB.mdb")
randomize
rdm=int(rnd*15)+246
sql = "SELECT * FROM kbs WHERE kbs.id = " & rdm & " AND kbs.subject NOT IN (20,21)"
set rs=conn.execute(sql)
%>
It's selecting a range of product IDs and it's s'posed to exclude all IDs whose subject is either subjectID 20 or 21. It works fine except when it comes to items with those subjects and then it displays this error message:
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
View Replies
View Related
I want to do something that should be simple, it is in php, but i can't seem to find any array functions in asp to do this. I have an array with x number of items (the x may change, could be 10/50/etc.) that will start with 1 and end with x.
For example (excuse my poor syntax):
myArray[0] = 1
myArray[1] = 2
myArray[2] = 3
myArray[3] = 4
etc.
What I want is to call a function and randomize the array as a new array, so for example:
randArray[0] = 3
randArray[1] = 1
randArray[2] = 4
randArray[3] = 2
View Replies
View Related
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 Related
here 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.
View Replies
View Related
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?
View Replies
View Related
how I generate a new XML file that I can then use with an XSLT file. I am trying to use an XML file generated from Microsoft Project or even better generate an XML file from the project file (MPP File) itself. Which I can then use with an XSLT file
I am new to XML and want to create a project viewer using XML, ASP and XHTML. I have an idea of how this should work but would really appritiate any help someone can offer. Is it possible to take an XML file and generate it in ASP without using an XSLT file??
View Replies
View Related
I've been trying to Google this but have been getting far too many hits to be of use. Is there a slick way to generate a CSV or other Excel-friendly format and push it to the client? I'm using VBScript (and HTML and other typical stuff of course) on the ASP pages (no .NET stuff). Just a shove in the right direction is all I really need here.
View Replies
View Related
how can i generate ID(automatically) when user press the "New Record" button in my registration pages.the ID will get from the existing database and start with C01234.let says the last id in database is C01234,then when the New Record is entered,then the id number will change to C01235.
View Replies
View Related
I noticed that PHP have the ability to create PDF files without using any third partty componentys. Most notably is via FPDF. It generates PDF by using "pdf markups" / or ghostscripts .
I believe the same can be done via ASP too. One has to use response.write pdf headers. Has anyone succeeded in doing that? I have the intention to go thru PHP's FPDF and try to convert that to VBScript.
View Replies
View Related
I trying to generate a new XML file everytime a user post a value through a simple form.
The form has one textfield called "price" and I want to save a new XML file (rewriting the file if the case) using the value entered. I don't want to append the value. I saw many turorials, but none of them work for me, and everytime I try to edit them, nothing seems to work.
View Replies
View Related
Can you tell me how to generate a GUID value in ASP?
View Replies
View Related
I want to create an Excel object from an ASP page. Basically, the input parameters to the Excel would be from the ASP. I know ASP and I know VBA, but I haven't used both of them together. Here's what I would like to do -
The ASP should generate an Excel report by passing 2 parameters to the Excel application (I have done this independently; without interfacing with ASP).
I know that I can create an excel handle from the ASP as -
Set MyExcel = Server.CreateObject("Excel.Application")
I dont know where the VBA code has to go? DO I have to include it in the ASP?
View Replies
View Related
I have a web page using frameset split into few pages. And I want to generate one page of HTML code and send it through email. My question is have to generate a HTML page using asp?
View Replies
View Related
I want to be able to generate a date (day,month,year)
and add it to a DB so as to prove when a record was added(when a transaction was completed)I then want to delete a record automatically 1 day after the date was generated.
View Replies
View Related
I have a form which contains drop down box with several available selections. Based on the users selection, I would like to have a popup box appear upon the form submission that gives them some additional information about their dropdown box selection. Is this possible?If so, how do I go about doing something like this?
View Replies
View Related
i have a long recordset that i want to page through. can sql pass back say, 5 records from 20 to 25 out of 1000?
i can then pass 2 variables between the pages to dynamically generate the sql and thus page through the results. can someone post up a simple example of this if its possible?
View Replies
View Related
I have design a single row (which includes text box and combo box) with muptilpe columns. When user enters a one details (for example: employee id), the other boxes will be automatically be filled in with that employees details. This I can do. However, how if I want to add more rows (to get more than one employee's details)? I can add rows but then the previous info (say on row one) goes missing
View Replies
View Related
I've looked around for a good while trying to figure out how to do this... and I need your help.I have a web page that is dynamically generated and it display rows from a DB and the rows get to be in the 100s. I need to break it up into sections... but I'm not sure how to go about doing it.What I'm wanting is something like this:
<< Previous 1 | 2 | 3 | 4 Next >>
(kindof like what is at the bottom of the forums here)
View Replies
View Related
I have two webpages main.asp with some codes and text.html I need joint
(insert) text into main.asp.
I forgotten instructions to insert first webpage into second. How I can do
it?
View Replies
View Related
I need to create a table with 4 cols and X rows based on the number records
in my database. I dont know how this can be done, mabye with an array?
If I got for example 6 records in my database, a table with 4 cols and 2
rows should be generated, the last row will only have 2 cols with
information... Code:
View Replies
View Related
currently, i export data from ASP to Excel. but i want to change it to RTF. i have looked at microsoft website and tried whay i have studied but failed to make it. at microsoft website, the table is created using rtf script but in my case, i just want to create it using html script.
and then, when user click PRINT button, i want my system shows the detail contents of rtf file and then open the Print window later. so user does not need to click File->Print and so on. is there any example script i can study?
View Replies
View Related
I'm trying to generate three random different numbers to display three images on a page without repeating them. I can't seem to be able to get them to always be different. There's probably some simple solution, but I can't figure it out.
Here's my current code: ....
View Replies
View Related