473,508 Members | 3,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time based diaplay of images

5 New Member
I have a website for a radio station that uses an access database. I need to be able to pull the image of the dj currently on the air based on the time their show is on. So it will have to call the time from the server.

I have these fields in the database: On_Air_Day, On_Air_Time, Off_Air_Time and On_Air_FP_Image.

So I need to pull the On_Air_FP_Image where On_Air_Day and On_Air_Time are = to the current day and time which is pulled from the servers time. It will continue to display that image until the next On_Air_Day and On_Air_Time are met.

So we may have a dj on the air on monday at 9am so his image is diplayed and at 12pm that same day another dj is on the air so the image changes to his image and so on. That same process is continued every day of the week.

Can someone please help with this.
Feb 23 '07 #1
4 1311
mwood
5 New Member
This is one thing I tried which didn't work.

<%
strSQLQuery = "SELECT * FROM On_Air_Staff where On_Air_Day and On_Air_Time =now()"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn, 3, 3
%>

<%=rs("On_Air_FP_Image")%>

<%
rs.movenext
loop
%>
Feb 23 '07 #2
mwood
5 New Member
Does anyone have any ideas that might help me with this?
Feb 27 '07 #3
clain
79 New Member
call a function which gets the image from DB

name the image in sequence ,for eg image 1,image 2, image 3 etc...

add a session variable which stores the image sequence like 1,2,3

call a function to refresh the page in intervals ( use java script settimout() or use ADDheader in asp)

increment the session variable by 1 while calling the querry... done...

cheers happy coding.....

for more clarification Contact me clain4u@yahoo.co.in
Feb 27 '07 #4
jhardman
3,406 Recognized Expert Specialist
This is one thing I tried which didn't work.

<%
strSQLQuery = "SELECT * FROM On_Air_Staff where On_Air_Day and On_Air_Time =now()"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn, 3, 3
%>

<%=rs("On_Air_FP_Image")%>

<%
rs.movenext
loop
%>
I don't think "now()" is recognized by sql. Also, What are the formats of On_Air_Day and On_Air_Time? it seems pretty unlikely that both will be equal to now(). Try:
Expand|Select|Wrap|Line Numbers
  1. dim currentDayOfWeek, currentTime
  2. currentDayOfWeek = weekDay(date)
  3. currentTime = now()
  4. strSQLQuery = "SELECT * FROM On_Air_Staff"
  5. strSQLQuery = strSQLQuery & " WHERE On_Air_Day = " & currentDayOfWeek
  6. strSQLQuery = strSQLQuery & " AND On_Air_Time < " & currentTime
  7. strSQLQuery = strSQLQuery & " AND Off_Air_Time > " & currentTime
  8. response.write "<!-- " & strSQLQuery & " -->" & vbNewLine
  9. Set rs = Server.CreateObject("ADODB.Recordset")
  10. rs.Open strSQLQuery, conn, 3, 3
  11.  
After you run, check the comment to see if the query is reasonable.

Please let me know if this helps.

Jared
Feb 28 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1597
by: eric rudolph | last post by:
1. I'm designing a PHP-based page that has a lot of design stuff in it. It's very tough to mix the HTML and PHP and have it be readable. The site isn't overall so complicated, there's just a lot of...
0
2239
by: Jim Mitchell | last post by:
I have the code snippet below. I fill a table of imagebuttons and would like to know which one was clicked to trigger the post back. Unfortunately, the Command event does not fire unless I load...
2
1699
by: Got2Go | last post by:
Hello, I am trying to come up with a function that will search the source of the page for a specific string. If that string is found, then have it modify specific tags inside of a table and...
3
1752
by: Ted Burhan | last post by:
Hi all, I'm trying to display a real-time data in one form or another (i.e. animation/graphic file, or just a text) in asp.net. The data for the images/text is retrieved from a SQL Server...
13
1672
by: david | last post by:
I can not figure out what is the problem that I can protect ASP.NEt form resource but not some other type of files, for example, images. All my aspx forms located in Demo folder and image files...
13
3240
by: Jim Carlock | last post by:
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I...
1
6486
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
4037
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
23
3190
by: mosesdinakaran | last post by:
Hi All, I need a small clarification in submitting the forms, Ur suggestions please. In a page I have two form and also two submit butons. (ie)
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.