Link to home
Start Free TrialLog in
Avatar of Joleen
Joleen

asked on

Ok, Access 2000 and Calendarcontrol

Hi,

Here is my question, I'm new to databases and handling them.
I like to read out an date filed in a access database, and set in a Calendar monthview the date bold.
So if the date exists set it to bold in the monthview.

The access database has an table with: ID | Event | Date | Location | Description | Category

I do not know how to query a access database so if you could give an example it would be very pleased.

Kind Regards, Joleen
Avatar of MYLim
MYLim

'Demo about using Ado to retrieve database info
'Please Start VB6.0 application- goto Project - goto Reference - check 'Microsoft ActiveX data Control 2.7 library'
'Also dtpicker inside 'Microsoft Common control 6.0 '

Dim Cnn As ADODB.Connection
Dim Rs As ADODB.Recordset
 
Private sub form_load()
On error goto ErrFound
Dim DbPath as string
DbPath = "C:\Test.mdb"

Set Cnn = New ADODB.Connection
Cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DbPath & ";User Id=admin;Password=;"

Set Rs = New ADODB.Recordset
Rs.CursorLocation = adUseClient
Rs.Open "Select * from Table1", Cnn, adOpenStatic, adLockReadOnly

if Rs.eof = true then
 msgbox "Empty Recordset,Connection will be Close"
 rs.close
 set rs=  nothing

  Cnn.close
 set Cnn = nothing
 
 exit sub
end if

text1.text = rs.fields(0).value & " "
text2.text = rs.fields(1).value & " "


if isnull (rs.fields(2).value) = false then
   dtpicker1.value = rs.fields(2).value
end if

text4.text = rs.fields(3).value & " "
text5.text = rs.fields(4).value & " "

 rs.close
 set rs=  nothing

  Cnn.close
 set Cnn = nothing
 
 exit sub
ErrFound:
msgbox "Err description : " & Err.Description
if rs.state=adstateOpen Then
  rs.close
  set rs = nothing
end if
 
if Cnn.state = adstateOpen then
  Cnn.close
  set Cnn = nothing
end if
end sub
Avatar of Joleen

ASKER

I'm sorry MYLim,

But you didn't read the question at all.

Joleen.
I can't help but say something here, but...

'I do not know how to query a access database' and this is in a VB newsgroup so I guess MYLim assumed you wanted to query a database in VB. You should probably be more specific if you want something else.
Avatar of Joleen

ASKER

Yeah I know, but that is not my main question.

Cheers, Joleen
Do you mean set a date bold in the flyout calendar view on a date picker? AFAIK it can't be done unless you want to develop your own custom control.



Avatar of Joleen

ASKER

No I Don't, it should be on a MonthView Control, Do you mean that I have to draw it on a form?

Cheers, Joleen
hmmm I can't find a MonthView control and I can't get the Microsoft Calendar Control to work. So sorry, can't help you.
ASKER CERTIFIED SOLUTION
Avatar of MYLim
MYLim

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

Split MYLim, nmcdermaid

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

leonstryker
EE Cleanup Volunteer