Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - SQL Server Events
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL Server Events

 Post Reply Post Reply
Author
Message
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Topic: SQL Server Events
    Posted: 12 July 2006 at 3:56pm
Ok, I'm probably just old, tired and slow but I am having an extremely difficult time getting the Calendar to connect to a SQL Server 2000 database and then populate the events.

Does anyone have a function or small sample that they could share?

Thanks!
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 12 July 2006 at 4:12pm
Maybe I should give more explanation of what I am trying to do.

I have 2 tables in a sql server database.  One for employees and one for days they request to have off for any number of reasons (Vacation, Personal, Sick, Jury Duty, etc...)

I just want a person to be able to fill out a form with the reason of the request from a combo box, a start date and an end date.  I have that data being stored in the database with no problem.  The problem comes with trying to get the event to display on the calendar.  It seems that, unless I am missing something which I probably am, it is more complicated than it needs to be.

Sorry to sound cranky.  One of those days.

Thanks!
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 13 July 2006 at 12:29pm
Ok.  After some sleep and some time not thinking about it at all, I took another look and figured it out enough to get done what I need.  It's actually pretty simple.

With rsDays
        .Open sql, db, adOpenForwardOnly, adLockReadOnly
       
        Do While Not .EOF
            Set NewEvent = Calendar.DataProvider.CreateEvent
       
            NewEvent.StartTime = CDate(!StartDate)
            NewEvent.EndTime = DateAdd("d", 1, CDate(!EndDate))
            NewEvent.AllDayEvent = True
            NewEvent.Label = !RequestTypeID
            NewEvent.Subject = !FirstName & " " & !LastName & "-" & !RequestType
            NewEvent.Body = !FirstName & " " & !LastName & "-" & !RequestType
            'NewEvent.ReminderSoundFile = ".."
           
            Calendar.DataProvider.AddEvent NewEvent
            Calendar.Populate
   
            .MoveNext
        Loop
        .Close
    End With


Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2006 at 7:08pm
I'd also suggest to change this piece of code by calling Calendar.Populate at the end of the loop to avoid some overhead calculations.

--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.160 seconds.