PDA

Click to See Complete Forum and Search --> : creating session in VB6 using CDONTS


muralidhar
Jun 24th, 2006, 05:33 AM
hai
im doing a project.i created a CDONTS session. i want to create a session for username. when im trying to create a session using the following code

ses.Session("uname") = txtUName.Text

but im getting an error

Run-time error '-2147219963(80040605)'
Methid 'Session' of object 'ISession' failed.

how can i create a session? :confused:
please help me Rob

westconn1
Jun 24th, 2006, 05:57 AM
here is some old code from when i was using cdo, but i don't have cdo now as this program wouldn't work in XP using this method

Dim MySession As Session
Dim Mymsg As Message
Dim Mymessagecol As Messages
Dim Myrecipscol As Recipients
Dim Myrecip As Recipient
Dim Myattcol As Attachments
Dim Myatt As Attachment
Dim a, b, c, d, e, x
On Error GoTo error4xx
Set MySession = New Session
On Error Resume Next
MySession.Logon profile, , True, True

Set Mymessagecol = MySession.Outbox.Messages
Set Mymsg = Mymessagecol.Add
Set Myrecipscol = Mymsg.Recipients
Set Myrecip = Myrecipscol.Add
Set Myattcol = Mymsg.Attachments
Set Myatt = Myattcol.Add


pete