I have this code that displays record sets at random, but some of time the results are less than the minimum set, which is 5 records. It is less, or none at all. What I need is for the asp to display records randomly on each submit.
Currently, the asp runs so that the whole recordset is different, i.e. Random. I am a little concerned about the load on the server by running such a script....perhaps someone can clarify.
'Set the number of records to display on each page by the constant set at the top of the script Code:
I want to provide random image on my asp page. the image will display according to products searched by user.
e.g.
if user enter pharma machine in search box, in result page the banner of pharma company will display. i.e. the banner of manufaturer/exporter of pharma machine will display.
dusring registration, comapny has to specify whether it wants banner or not. so if there is yes in banner and prodcuts match the search string then banner will display.
this is according to the product seaarched by user.
Now What i am trying to do is , when the first time is student is login,he wil be shown a random record from the question and his answered wil be stored in the Ans field of the student table with column separeated.
The he will be redirected to the same page with one new question.This question should not be in the Ans Field, and must be randomly generated.I am using this code.But this not working. Code:
I am trying to retrieve images from the database and display them in a random order. The order of the images is supposed to change each time page is refreshed. Below is my code, I am using an array to store the images but the images are not displayed for some reason. Code:
On my index page I have got an area for one product to be displayed randomly from the database. I have got it workign, but there is one problem i cant get my head around, here is the code so far:
' Initialize ASP RND() function Randomize() intRandomNumber = Int (1000*Rnd)+1
I’m having problems on how to randomiz numbers and delete the ones that have been displayed.
My first step is to take some numbers:
21, 32, 35, 4, 15 and randomize theese so the ouput may look something like this: 35, 21, 15, 32, 4
My second step is to display the first number (35), then when a user clicks on a link I want the second of my random number (21) to be displayed and I also want to delete the first number (35) that has been displayed. And this routine (display number, delete previous number) should continoue untill there is no more numbers. So again, I wnat to step through all my random numbers and delete the ones I have displayed.
I Have searched the forum but have no solution to this problem.
I want to display my records in a random order. I loop through my records so I don't know how many records will be displayed. I dont want to count the records and then use the TOP statement. I'm looking for a better solution.
Set rs = Server.CreateObject("ADODB.Recordset") rs.Open SELECT test FROM testTable WHERE testId = 1, objConn Do While Not rs.EOF Response.Write "<b>" & rs("test") & "</b>" <- I want theese records to be displayed in random order rs.MoveNext Loop
I am trying to retrieve images from the database and display them in a random order. The order of the images is supposed to change each time page is refreshed.
Below is my code, I am using an array to store the images but the images are not displayed for some reason. Any help would be appreciated.
<% Dim rstResult Dim strSQL Dim img(100) imgID = 0 set rstResult = Server.CreateObject("ADODB.Recordset") strSQL = "sp_sel_TilesByType 'O'" rstResult.Open strSQL, strConnect
I have a database with 20 companies and their links in it. Ive tried to develop some code that i found in another forum while i was searching for a solution to 'unique random links' but, although i feel im close, Code:
I have an 2000 Access database that stores job listings from potential employers for a school. I would like to be able to display the date on a webpage the last time the database was updated (inputed through asp natch').
The database is not updated everyday so that won't work but something like the database was updated on Monday 11/24/2003, I would want it to say "New job listings as of Monday, 11/24/2003" if it were checked on Tuesday or whenever. Code:
i want to display my record on asp page as follows:
custid ordernum 1 101 1 102 3 104 3 105
that is with only the ones with more than 1 order. how can i manipulate the display...and i cant(i mean i have no permissions) change my query to do this.
im wanting to display a full recordset from an access database and sort it by the "map" field seen below which works but i get this error between my second last and last records when theyre displayed:
ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed.
I'm trying to create a page that uses a recordset to display user information such as: username, email address, first and last name. As soon as the page loads I would like the user information to be displayed. I have a user database, I just need to know how to get the recordset to display the information specific to the user that is logged in.
column2: I like apples. I like bananas. I like grapes.
I'm trying to have it where the choices from column1 are provided on the form, and based on the what was chosen on the form the corresponding choices from column2 are display on the page.
I have a simple recordset which selects various fields from an SQL table on my ASP page and displays them accordingly. However, ones of the fields is set to DATETIME(starttime). How do I get that field to display the time rather than both the time and the appended date?
However, what I want to do is include a request.querystring("ID"), so that IF an ID is defined, eg ID=3, , it will display the relevant (not random) information. I've tried this every way I can think and get type mismatches, etc etc. It's probably really simple but I can't see it.
We have the need to have a random token (a 16 char alphanumeric field) to be used as the key for one of our SQL tables. I have created a random token generator, however after only 3 months in production, it appears that we had an instance where a token that already existed in the tables was created. There are 3810 records currently in the database so it isn't like there are billions of records there.
I contacted an old college buddy of mine who is a mathematician, and he claims, assuming that random really does mean random, that the chances of getting a duplicate token are 1 in 79.5 septillion (79,500,000,000,000,000,000,000,000).
So my conclusion is that this was either a complete freak of nature occurance, or my random generator isn't really all that random. Here is the code behind how I am generating this: Code:
I am trying to generate a random number. I am using randomize and then rnd to return a decimal number between 100 and 120. This will give me a longitude. I am doing something similar to generate a latitude.
I created this on a page which refreshs every minute. I put these points into a map and they are showing up in groups of straight lines. Since rnd is time based will refreshing every 60 seconds return similar numbers?
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 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:
Agreed its not the best code, but he is finding that the same image could be repeated like three times in a run.
I have an include file which displays the image, and the random script is placed inside that include. So when he is going from page to page this is where the issue lies.
Can anyone help me out here, is it even possible to have a different image load each time, and not have them repeating.
I am using random number to be used as a unique identifir. Since random numbers are in decimals I am using going to convert it into an integer and since I need to append this Id into my URL, I am converting it into a string. SO my formula looks like this.
CStr(Int((Highest-Lowest+1)*Rnd+Lowest))
S0 now every time a new record is generated would this formula generate a unique number for unique identification in the table. I can't see how it can do it. Say A user is assigned a random number; then another user subscribes so how would the server determines that the random value assigned to next user is not already assigned to any other user.
In case if this can't work (a unique ID for every user) then I'll stick to this very same formula and after the random number is generated, I'll check this number with the table in the database and see whether it's been assigned already. If yes, I'll request another random value, if not then I'll go with it. Is this the right strategy?
I have done random image display with the help suggestion from this discussion form. now I want to provide link on each image. i.e. all the images display randomly, should have different link. is it possible? if yes, how?
is there sombody who can helpme witht he following, i am ''pretty new'' to php and am looking for a script to show images randomly at a 10/ 15 seconds interval. is there anybody who can help me with this or does know where to find a good template script for this?
I have the below ASP function to display a random image from a folder.
<% Function RandomImage(strPath) Randomize()
If Right(strPath, 1) <> Chr(47) Then strPath = strPath & Chr(47) strPhysical = Server.MapPath(strPath) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("C:Inetpubwwwrootpag-siteimages andoms") Set objFiles = objFolder.Files
For Each objFile in objFiles strFile = LCase(objFile.Name) strFiles = strFiles & strFile & vbTab Next
strImages = Split(strFiles, vbTab) If UBound(strImages) > 1 Then RandomImage = strPath & strImages(Int(Rnd(1)*UBound(strImages))) End If End Function %>