ASP/Javascript and ACCESS DB (1 Viewer)

craigprice

Registered User.
Local time
Today, 23:00
Joined
Apr 8, 2013
Messages
44
Basically I have my DB file which users connect to via a F/E form.

I'm happy to load the data once and then if the number of items in the query changes then the recordset/array is recreated rather than pulling all the time.

Bascially what will happen is Managers will input any ongoing service issues.

If the issue is of high importance then can select to place this on a central display these items are listed in qryCWView

I basically need to build from that and if there is a new item that becomes available in the query then display this, at the same time removing any that leave the query.

I had been semi successful with this code however I dont understand how you would make it dynamic in the sense of adding more "slides"

Code:
<!-- #include file="db.asp" --> 
02  
03<% 
04whiteboard = "SELECT qryCWVIEW.service, qryCWVIEW.problem, qryCWVIEW.issueinfo, qryCWVIEW.PRIORITY FROM qryCWVIEW;"
05SET rswb = Conn.execute( whiteboard ) 
06  
07recordsArray = rswb.GetRows() 
08  
09rswb.close 
10  
11  
12%> 
13  
14  
15  
16  
17<html> 
18 <head> 
19 <title>Service Issues Test</title> 
20  
21  
22<script type="text/javascript">  
23  
24  
25  
26var quotations = new Array() 
27    quotations[0]= "<b>SERVICE: <%=recordsArray(0,0)%><br>PROBLEM: <%=recordsArray(1,0)%><br> PRIORITY: <%=recordsArray(3,0)%><br>ISSUE INFO:<br> <%=recordsArray(2,0)%>"
28quotations[1]= "<b>SERVICE: <%=recordsArray(0,1)%><br>PROBLEM: <%=recordsArray(1,1)%><br> PRIORITY: <%=recordsArray(3,1)%><br>ISSUE INFO:<br> <%=recordsArray(2,1)%>"
29  
30quotations.close 
31  
32      
33  
34  
35function display()  
36{  
37a=Math.floor(Math.random()*quotations.length)  
38document.getElementById('quotation').innerHTML=quotations[a] 
39  
40setTimeout("display()",8000) 
41  
42}  
43  
44  
45  
46  
47</SCRIPT>  
48  
49<script type="text/javascript">  
50setTimeout(function(){ 
51window.location.reload(1); 
52},120000); 
53</SCRIPT> 
54  
55  
56  
57  
58  
59 </head> 
60 <body bgcolor="#629632" text="white"> 
61  
62  
63  
64  
65<b><u><font size="35">SERVICE ISSUES</font></u></b> 
66<br> 
67  
68  
69<div id="quotation" style="background-color:#629632; width: 500px; height: 100px; padding: 5px 0 0 5px;">  
70<script type="text/javascript">display()</SCRIPT>  
71</div>  
72  
73  
74  
75 </body> 
76 </html>
<!-- #include file="db.asp" --> 
02  
03<% 
04whiteboard = "SELECT qryCWVIEW.service, qryCWVIEW.problem, qryCWVIEW.issueinfo, qryCWVIEW.PRIORITY FROM qryCWVIEW;"
05SET rswb = Conn.execute( whiteboard ) 
06  
07recordsArray = rswb.GetRows() 
08  
09rswb.close 
10  
11  
12%> 
13  
14  
15  
16  
17<html> 
18 <head> 
19 <title>Service Issues Test</title> 
20  
21  
22<script type="text/javascript">  
23  
24  
25  
26var quotations = new Array() 
27    quotations[0]= "<b>SERVICE: <%=recordsArray(0,0)%><br>PROBLEM: <%=recordsArray(1,0)%><br> PRIORITY: <%=recordsArray(3,0)%><br>ISSUE INFO:<br> <%=recordsArray(2,0)%>"
28quotations[1]= "<b>SERVICE: <%=recordsArray(0,1)%><br>PROBLEM: <%=recordsArray(1,1)%><br> PRIORITY: <%=recordsArray(3,1)%><br>ISSUE INFO:<br> <%=recordsArray(2,1)%>"
29  
30quotations.close 
31  
32      
33  
34  
35function display()  
36{  
37a=Math.floor(Math.random()*quotations.length)  
38document.getElementById('quotation').innerHTML=quotations[a] 
39  
40setTimeout("display()",8000) 
41  
42}  
43  
44  
45  
46  
47</SCRIPT>  
48  
49<script type="text/javascript">  
50setTimeout(function(){ 
51window.location.reload(1); 
52},120000); 
53</SCRIPT> 
54  
55  
56  
57  
58  
59 </head> 
60 <body bgcolor="#629632" text="white"> 
61  
62  
63  
64  
65<b><u><font size="35">SERVICE ISSUES</font></u></b> 
66<br> 
67  
68  
69<div id="quotation" style="background-color:#629632; width: 500px; height: 100px; padding: 5px 0 0 5px;">  
70<script type="text/javascript">display()</SCRIPT>  
71</div>  
72  
73  
74  
75 </body> 
76 </html>
<!-- #include file="db.asp" --> 
02  
03<% 
04whiteboard = "SELECT qryCWVIEW.service, qryCWVIEW.problem, qryCWVIEW.issueinfo, qryCWVIEW.PRIORITY FROM qryCWVIEW;"
05SET rswb = Conn.execute( whiteboard ) 
06  
07recordsArray = rswb.GetRows() 
08  
09rswb.close 
10  
11  
12%> 
13  
14  
15  
16  
17<html> 
18 <head> 
19 <title>Service Issues Test</title> 
20  
21  
22<script type="text/javascript">  
23  
24  
25  
26var quotations = new Array() 
27    quotations[0]= "<b>SERVICE: <%=recordsArray(0,0)%><br>PROBLEM: <%=recordsArray(1,0)%><br> PRIORITY: <%=recordsArray(3,0)%><br>ISSUE INFO:<br> <%=recordsArray(2,0)%>"
28quotations[1]= "<b>SERVICE: <%=recordsArray(0,1)%><br>PROBLEM: <%=recordsArray(1,1)%><br> PRIORITY: <%=recordsArray(3,1)%><br>ISSUE INFO:<br> <%=recordsArray(2,1)%>"
29  
30quotations.close 
31  
32      
33  
34  
35function display()  
36{  
37a=Math.floor(Math.random()*quotations.length)  
38document.getElementById('quotation').innerHTML=quotations[a] 
39  
40setTimeout("display()",8000) 
41  
42}  
43  
44  
45  
46  
47</SCRIPT>  
48  
49<script type="text/javascript">  
50setTimeout(function(){ 
51window.location.reload(1); 
52},120000); 
53</SCRIPT> 
54  
55  
56  
57  
58  
59 </head> 
60 <body bgcolor="#629632" text="white"> 
61  
62  
63  
64  
65<b><u><font size="35">SERVICE ISSUES</font></u></b> 
66<br> 
67  
68  
69<div id="quotation" style="background-color:#629632; width: 500px; height: 100px; padding: 5px 0 0 5px;">  
70<script type="text/javascript">display()</SCRIPT>  
71</div>  
72  
73  
74  
75 </body> 
76 </html>
 
<!-- #include file="db.asp" -->
<%
whiteboard = "SELECT qryCWVIEW.service, qryCWVIEW.problem, qryCWVIEW.issueinfo, qryCWVIEW.PRIORITY FROM qryCWVIEW;"
SET rswb = Conn.execute( whiteboard )
recordsArray = rswb.GetRows()
rswb.close

%>
 

<html>
 <head>
 <title>Service Issues Test</title>

<SCRIPT type="text/javascript"> 
 
var quotations = new Array()
    quotations[0]= "<b>SERVICE: <%=recordsArray(0,0)%><br>PROBLEM: <%=recordsArray(1,0)%><br> PRIORITY: <%=recordsArray(3,0)%><br>ISSUE INFO:<br> <%=recordsArray(2,0)%>"
quotations[1]= "<b>SERVICE: <%=recordsArray(0,1)%><br>PROBLEM: <%=recordsArray(1,1)%><br> PRIORITY: <%=recordsArray(3,1)%><br>ISSUE INFO:<br> <%=recordsArray(2,1)%>"
quotations.close
 

function display() 
{ 
a=Math.floor(Math.random()*quotations.length) 
document.getElementById('quotation').innerHTML=quotations[a]
setTimeout("display()",8000)
} 
 

</SCRIPT> 
<SCRIPT type="text/javascript"> 
setTimeout(function(){
window.location.reload(1);
},120000);
</SCRIPT>
 
 
 </head>
 <body bgcolor="#629632" text="white">
 

<b><u><font size="35">SERVICE ISSUES</font></u></b>
<br>

<div id="quotation" style="background-color:#629632; width: 500px; height: 100px; padding: 5px 0 0 5px;"> 
<SCRIPT type="text/javascript">display()</SCRIPT> 
</div> 
 
 </body>
 </html>

What I want to be able to do is have multiple slides add/remove.

I have this but obviously I'd need to go up for each potential record in the recordset however if the record doesnt exist it fails.

Does anyone know if I could dynamically add these slides?

Code:
var quotations = new Array()
    quotations[0]= "<b>SERVICE: <%=recordsArray(0,0)%><br>PROBLEM: <%=recordsArray(1,0)%><br> PRIORITY: <%=recordsArray(3,0)%><br>ISSUE INFO:<br> <%=recordsArray(2,0)%>"
quotations[1]= "<b>SERVICE: <%=recordsArray(0,1)%><br>PROBLEM: <%=recordsArray(1,1)%><br> PRIORITY: <%=recordsArray(3,1)%><br>ISSUE INFO:<br> <%=recordsArray(2,1)%>"
quotations.close
 

Users who are viewing this thread

Top Bottom