nevets2001uk
IS-IT--Management
Originally posted in the ASP.NET forum I have the following problem...
If am working from an Access Database and would like to pull a recrod at random from my database to display in a random photograph section of my new website. I had this working in SQL but had to move back to access for hosting at this time.
Here is what I've got based on a few google searches. The problem I have is that although requerying the table does cycle through different photographs it doesn't do it randomly and I always get the same sequence of photos.
SELECT TOP 1 PHOTOGRAPH_ID, RND([PHOTOGRAPH_ID]) AS RANDOMID, GALLERY_ID, TITLE, REFERENCE FROM PHOTOGRAPHS ORDER BY Rnd([PHOTOGRAPH_ID]) DESC
Any thoughts how to do this? The query is inside a table adapter which might make a difference?
Steve G (MCSE / MCSA:Messaging)
If am working from an Access Database and would like to pull a recrod at random from my database to display in a random photograph section of my new website. I had this working in SQL but had to move back to access for hosting at this time.
Here is what I've got based on a few google searches. The problem I have is that although requerying the table does cycle through different photographs it doesn't do it randomly and I always get the same sequence of photos.
SELECT TOP 1 PHOTOGRAPH_ID, RND([PHOTOGRAPH_ID]) AS RANDOMID, GALLERY_ID, TITLE, REFERENCE FROM PHOTOGRAPHS ORDER BY Rnd([PHOTOGRAPH_ID]) DESC
Any thoughts how to do this? The query is inside a table adapter which might make a difference?
Steve G (MCSE / MCSA:Messaging)