473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

The information is not writing to muy array in ASP

HI there,
I really hope you can help as this is driving me mad!

I am trying to set up a calender on my site for events and found a
neat looking script. All works except the events aren't being writting
to the array. The code section i think is important is below

***********
sql = "SELECT id, startDate, endDate, name FROM calendarEvent " & _
"WHERE ((startDate >= #" & searchStart & "# AND endDate <= #" &
searchEnd & "#) " & _
"OR (startDate < #" & searchStart & "# AND endDate >= #" &
searchStart & "# AND endDate <= #" & searchEnd & "#) " & _
"OR (startDate <= #" & searchEnd & "# AND startDate >= #" &
searchStart & "# AND endDate > #" & searchEnd & "#) " & _
"OR (startDate < #" & searchStart & "# AND endDate > #" & searchEnd
& "#)) "
if trim(eventType) = "" then
'ignore it
elseif cint(eventType) = 1 then
sql = sql & "AND eventType = 1"
elseif cint(eventType) = 2 then
sql = sql & "AND eventType = 2"
elseif cint(eventType) = 3 then
sql = sql & "AND eventType = 3"
elseif cint(eventType) = 4 then
sql = sql & "AND eventType = 4"
else
'ignore it
end if
Set rs_getEvent = cn_Connection.Execute(sql)
%><%response.write("sql = " & sql & "<br>")%><%
sql = ""
sql = "SELECT id, eventType FROM eventType"
Set rs_getType = cn_Connection.Execute(sql)

curDate = searchStart
for x = 1 to day(searchEnd)
redim preserve eventID(x)
redim preserve eventName(x)

if not rs_getEvent.BOF then rs_getEvent.movefirst
while not rs_getEvent.EOF
x1 = rs_getEvent("startDate")
x2 = rs_getEvent("endDate")
if x1 = curDate OR x2 = curDate OR (x1 < curDate AND x2 > curDate)
then
'make a list for event for each day
eventID(x) = eventID(x) & rs_getEvent("id") & "~||~"
eventName(x) = eventName(x) & rs_getEvent("name") & "~||~"
end if
rs_getEvent.movenext
wend
%><%response.write("<b>eventName("&x&") =
"&eventName(x)&"</b><br><br>")%><%'eventName(x)
'move current day to next day
curDate = dateAdd("d", 1, curDate)
next

'check if date is in this month
if dateFormat = 1 then
if Not month(DateAdd("d", curDay-1, curMonth & "/1/" & curYear)) =
cint(curMonth) then curDay = 1
lastDay = day(dateserial(curYear, curMonth+1, 1-1))
today = curMonth & "/" & curDay & "/" & curYear
else

if Not month(DateAdd("d", curDay-1, "1/" & curMonth & "/" &
curYear)) = cint(curMonth) then curDay = 1
lastDay = day(dateserial(curYear, curMonth+1, 1-1))
today = curDay & "/" & curMonth & "/" & curYear
end if
%>

********

Can anyone see anything why this would be happning - if you need more
information then i can email you all the code... it runs of a two
table database.

I really hope you can help..

Vicky
Jul 19 '05 #1
0 1409

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: rob | last post by:
hey every1, I've got alot of data to write out to file and it's all just 1's and 0's. It's all stored in 2 dimensional arrays of width 32 and varying height. At the moment it's all just...
5
by: Amir S. | last post by:
Hi, I'm a newbie to C++ (2 weeks into the course). We were given this assignment to write some code that reads a set of integers (grades) from a file (filename passed by console), outputs them...
42
by: Dan | last post by:
Hello, I have trouble with class calling. I am calling getvolume() with succes in the function CreateCircle but it do not want to call it in ShowCircle() function. I am staying in the same...
2
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
2
by: simonc | last post by:
Is there an easy way of writing a number in 32 bit integer format into four bytes of a file? I am experimenting with FilePut but I can only make it work by defining a four byte array and doing some...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
4
by: Drew | last post by:
This might beyond the scope of this group because it deals with SharePoint, but I'm not sure if I can't get it to work because of SharePoint or because JavaScript is weird (I don't have much...
10
by: deciacco | last post by:
I'm writing a command line utility to move some files. I'm dealing with thousands of files and I was wondering if anyone had any suggestions. This is what I have currently: $arrayVirtualFile =...
7
by: w1ck3d64 | last post by:
hi, i have an array of pixel information which i want to display with C/C++. I'm trying to use OpenCV at the moment but I don't have much experience writing pixel by pixel. Can someone show me a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.