1. jay rajan
  2. PowerBuilder
  3. Monday, 19 November 2018 14:04 PM UTC

i have an error - connecting to outlook -3

due to my code

li_return = ole_outlook.ConnectToNewObject("outlook.application")
//Check for the return code
If li_return <> 0 Then
Messagebox("Error",'Connecting to Outlook'+String(li_return))
Destroy ole_outlook
Return -1
End If

plase share with me reason of error with solution

please 

thanks

 

Alan Rice Accepted Answer Pending Moderation
  1. Monday, 19 November 2018 14:16 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

I've had this issue before and it was due to permissions being set when connecting to Outlook. It also seems to be happening more with each update that MS bring out (seems to reset a lot, might be due to local policies).

I would recommend checking the Trust Center on Outlook (File > Options > Trust Center > Trust Center Settings > Programmatic Access) and checking if you need to enable access here.

I also had an issue with this warning when the client had been running Outlook as Admin (counter-intuitive) but once they exited Outlook and ran it as normal it was fine : /

Best Regards,
Alan Rice

Comment
  1. jay rajan
  2. Tuesday, 20 November 2018 06:05 AM UTC
Thanks for helping me

but it is not working

Please the me the reason first that why this error accure



Actually my problem is

Error:- connecting to outlook-3



I have a code for connecting to outlook

li_return = ole_outlook.ConnectToNewObject("outlook.application")

//Check for the return code

If li_return 0 Then

Messagebox("Error",'Connecting to Outlook'+String(li_return))

Destroy ole_outlook

Return -1

End If

  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 19 November 2018 16:59 PM UTC
  2. PowerBuilder
  3. # 2

Another thing:

Your anitvirus has to be up-to-date. It seems to interfere with the programmatic access if it's not.

Comment
  1. jay rajan
  2. Tuesday, 20 November 2018 06:04 AM UTC
Thanks for helping me

but it is not working



Actually my problem is

Error:- connecting to outlook-3



I have a code for connecting to outlook

li_return = ole_outlook.ConnectToNewObject("outlook.application")

//Check for the return code

If li_return 0 Then

Messagebox("Error",'Connecting to Outlook'+String(li_return))

Destroy ole_outlook

Return -1

End If



Please help me
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 20 November 2018 08:21 AM UTC
  2. PowerBuilder
  3. # 3

Try downloading Roland's sample for Outlook programming on http://topwizprogramming.com/freecode_outlook.html

See if the ConnectToNewObject works with that application. If so, then something you're doing is wrong.

 

Comment
  1. jay rajan
  2. Tuesday, 20 November 2018 09:20 AM UTC
ok sir

thanks alot

I will try
  1. Helpful
There are no comments made yet.
jay rajan Accepted Answer Pending Moderation
  1. Wednesday, 21 November 2018 07:23 AM UTC
  2. PowerBuilder
  3. # 4

Thanks you so much sir

Finally your solution is successfully and easily done 

Thanks you so much

 

Comment
  1. jay rajan
  2. Wednesday, 21 November 2018 10:09 AM UTC
yeahhhhh



now

i am busy in some work so my powerbuilder is on but when i come back to powerbuilder work then error is accure that is dbprocess is dead

then i restart my powerbuilder then it is ok



can you please give the solution of "dbprocess is dead"
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 21 November 2018 11:10 AM UTC
Sounds like you're suffering a timeout from the database.

Which database are you using?

In Oracle, for example, you can set a parameter in the sqlnet.ora file too make the time out value bigger (can't remember which one it is right now).

Another thing you could do instead, is to do something with SQL in a timer event:



string ls_dummy

SELECT "dummy" INTO :ls_dummy FROM DUAL;



If you set the timer on your frame window (that is if your application is MDI based), then that would run every xx minutes. The database would notice the activity and not time out.



Another thing you can try is to not use a timer event, but do the select in the idle event of the application.
  1. Helpful
  1. jay rajan
  2. Thursday, 22 November 2018 12:50 PM UTC




thanks for reply

yes i am suffering a timeout from the database.



My application is MDI based and i am using sql server ..

but my idle event code is

Idle(18000) //code

means database is dead after 5hours

but really, db dead error come in 15-20 minutes

what I do?
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.