473,568 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error after 380 CreateObject("M API.Session")

Error: 80040108 after 380 CreateObject("M API.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("M API.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar
Nov 13 '05 #1
4 5017
You are Dim'ing MySeesion as MAPI.Session which you cannot do without
setting a reference. If you want to use early binding, set a reference. If
you want to use late binding, change your code to:

Dim MySession As Object

It should run fine, if you do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Ottar" <la*****@earthl ing.net> wrote in message
news:43******** *************** **@posting.goog le.com...
Error: 80040108 after 380 CreateObject("M API.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("M API.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar

Nov 13 '05 #2
No success unfornunatly, tried Dim MySession As Object same thing happens.

The code:
Dim MySession As MAPI.Session
Set MySession = CreateObject("M API.Session")

Is taken directly from Microsoft MSDN articles.

Any other suggestions? Could you try it on your PC? I've tried it on 3 PC's
with same result.

Best regards

Ottar

"Arvin Meyer" <a@m.com> wrote in message
news:#3******** ******@TK2MSFTN GP09.phx.gbl... You are Dim'ing MySeesion as MAPI.Session which you cannot do without
setting a reference. If you want to use early binding, set a reference. If
you want to use late binding, change your code to:

Dim MySession As Object

It should run fine, if you do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Ottar" <la*****@earthl ing.net> wrote in message
news:43******** *************** **@posting.goog le.com...
Error: 80040108 after 380 CreateObject("M API.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("M API.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar


Nov 13 '05 #3
No success unfornunatly, tried Dim MySession As Object; same thing happens.

The code:
Dim MySession As MAPI.Session
Set MySession = CreateObject("M API.Session")
Is taken directly from Microsoft MSDN articles.

Any other suggestions? Could you try it on your PC? I've tried it on 3 PC's
with same result.

Best regards

Ottar

"Arvin Meyer" <a@m.com> wrote in message news:<#3******* *******@TK2MSFT NGP09.phx.gbl>. .. You are Dim'ing MySeesion as MAPI.Session which you cannot do without
setting a reference. If you want to use early binding, set a reference. If
you want to use late binding, change your code to:

Dim MySession As Object

It should run fine, if you do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Ottar" <la*****@earthl ing.net> wrote in message
news:43******** *************** **@posting.goog le.com...
Error: 80040108 after 380 CreateObject("M API.Session")

Function MAPI_Test2()
Dim i As Integer
Dim MySession As MAPI.Session

i = 0
While (i < 2000)
Set MySession = CreateObject("M API.Session")
Debug.Print i
i = i + 1
Set MySession = Nothing
DoEvents
Wend
End Function

Any ideas?

Best regards
Ottar

Nov 13 '05 #4
"Ottar L. Osen" <la************ *@earthling.net > wrote in message
news:O3******** ******@TK2MSFTN GP12.phx.gbl...
No success unfornunatly, tried Dim MySession As Object same thing happens.

The code:
Dim MySession As MAPI.Session
Set MySession = CreateObject("M API.Session")

Is taken directly from Microsoft MSDN articles.

Any other suggestions? Could you try it on your PC? I've tried it on 3

PC's with same result.


I did try it on my PC, and it worked with the one change I showed.

I was able to generate 2000 counts in the debug window. Keep in mind that I
have a GB of memory, so I probably have enough to allocate to all those
instances of MAPI.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
Nov 13 '05 #5

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

Similar topics

1
3944
by: Fie Fie Niles | last post by:
I have IIS installed on XP Professional workstation machine. I have an ASP page that open connection to an Access database, then when trying to update the database, it gave me the error "cannot update database or object is read-only". This is a workstation machine, not connected to any other computer, and I login to the PC using an...
9
3652
by: bajopalabra | last post by:
hi session("myVar") = rs.getRows( ) don't work when number of records is greater than 10 does anybody know WHY ??? is it a Session object limitation ??? thanks
7
4181
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same code for 6 hours and stops. I've found the problem to be the Set MySession = CreateObject("MAPI.Session")
13
1889
by: dee | last post by:
Hi My code complies the following line: Session("passed") = 1 but puts wiggly error line under the second Session("passed") in the following expression: Session("passed") = Session("passed") + 1 Why? Thanks Dee.
10
2379
by: thomson | last post by:
Hi, i create a session variable in C# as follows Session , but iam not able to access the variable in VB.net like intmode=Session("var"); Why is that ? Regards
3
34449
by: Paul | last post by:
Hi All, In my application, I wished to check certain things on each page load, so rather than paste the same code in each pages constructor, I thought it would be more logical to inherit from Page and place the code in there. Then each webpage will inherit from my modified page class. This works fine, but if I try and access the Session...
0
2324
by: PShark | last post by:
Hi I have a VB6 app that uses MAPI to send and receive emails. My users are able to use the app to send emails successfully, but when there are new emails in the mailbox, the program opens the email but then raises the following error: "Automation error – The object invoked has disconnected from its clients." The same program is installed...
1
2343
by: patelxxx | last post by:
Hi Guy's, I'm getting the error: "Username or password did not match" BEFORE I even enter a username and password, can someone help? 1) The site I'm accessing is: http://www.valuemapping.co.uk/VMSE/ 2) Then I click/select the following application: "VMSE Reporting" and get the above error. The CGI script for this is:
3
16014
by: Kosmos | last post by:
Hey ya'll...I can't seem to figure out why I'm getting this error message, but it all started when I added the new line of code with the recSet5.AddNew --- when I ran the first line, the logic worked and the fields were populated properly, when I added all the rest, it wouldn't run and even when I tried to go back, it still won't run now...I am...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.