Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP problems (Application object error 'ASP 0197 : 80004005' )

Posted on 1999-06-29
13
Medium Priority
?
1,059 Views
Last Modified: 2013-12-24
The server is returning this error:

Application object error 'ASP 0197 : 80004005'

Disallowed object use

/pfin/global.asa, line 27

Cannot add object with apartment model behavior to the application intrinsic object.

The code at this line is like this :

Set aaa = Server.CreateObject("ADODB.Connection")
            aaa.Open "DSN=MYDSN1"
            Set Application("MyConnectionString") = aaa      
Can you tell me is there something wrong with the code, or the server configuration is not correct?

Thanks in advance
goro
0
Comment
Question by:goro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +3
13 Comments
 

Author Comment

by:goro
ID: 1867886
Adjusted points to 150
0
 
LVL 4

Expert Comment

by:siabod
ID: 1867887
You are trying to create an application variable of the type ADODB.connection, i fon't think this will fit, i'm not sure out of the top of my head what types you do can put into an application variable, but i don't think this is allowed, why do you want to store it like that anyway ?
0
 
LVL 1

Expert Comment

by:cbasic100798
ID: 1867888
Hi goro,

Try it without this line of code.
aaa.Open "DSN=MYDSN1"

The following is from April MSDN Library.

IIS version 5.0
If you assign a component instance to a variable in the Application Contents Collection, and use Visual Basic® Scripting Edition as your primary scripting language, you must use the Set keyword. This is illustrated in the following script.

<% Set Application("Obj1") = Server.CreateObject("MyComponent") %>
 
You can then reference the methods and properties of MyComponent on subsequent Web pages by using this script

<% Application("Obj1").MyObjMethod %>
 
or by extracting a local copy of the object and using the following

<%
Set MyLocalObj1 = Application("Obj1")
MyLocalObj1.MyObjMethod
%>

Hope this helps,
Clyde
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

Author Comment

by:goro
ID: 1867889
The problem may be is not like this, beacuse in one of the servers it works fine, but on another one it gave me this error(which is in the question).
May be there's something with the permissions, I have no idea....

goro
0
 
LVL 1

Expert Comment

by:cbasic100798
ID: 1867890
What version IIS?
Same sys admin for each server? If not check DSN pointer.
I would check with your sys admin about that server & version because your code works fine on mine and my ISP. 3 out of 4 work

This information is from "MyConnectionString" Provider=MSDASQL.1;Data Source=cb_weer;Connect Timeout=15;Extended Properties="DSN=cb_weer;DBQ=C:\Inetpub\wwwroot\cbasic\weer.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=5;";Locale Identifier=1033

Clyde
0
 
LVL 1

Expert Comment

by:cbasic100798
ID: 1867891
What version IIS?
Same sys admin for each server? If not check DSN pointer.
I would check with your sys admin about that server & version because your code works fine on mine and my ISP. 3 out of 4 work

This information is from "MyConnectionString" Provider=MSDASQL.1;Data Source=cb_weer;Connect Timeout=15;Extended Properties="DSN=cb_weer;DBQ=C:\Inetpub\wwwroot\cbasic\weer.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=5;";Locale Identifier=1033

Clyde
0
 

Author Comment

by:goro
ID: 1867892
The IIS is version 4, the DSN points to the database correctly, it's a system DSN.
I think the problem is something in the permissions, because when I moved the connection object from the Application, to the Session scope, it worked withiout problems.

goro
0
 

Expert Comment

by:JohnPerryn
ID: 1867893
There is lots of help for this available. Go to www.microsoft.com and select SEARCH. Enter the search string 80004005

Also read KB article Q175671
0
 

Expert Comment

by:WeeKeong
ID: 1867894
wat kind of software that u used to create ur database
if u used SQL server, pls try this code
Set aaa = Server.CreateObject("ADODB.Connection")
aaa.Open "DSN=MYDSN1;uid=ur user login name;pwd=ur password"

if u r using ms access to create ur database, pls check ur ODBC 32 data Sources in the control panel,if u use User or System DSN, it should not hav any problem.If u use File DSN
then try this code
aaa.Open "FILEDSN=C:\ur location where u put ur .dsn file"

hope can help it!
0
 

Author Comment

by:goro
ID: 1867895
Sorry, this is not the worng part here. I'm absolutely sure that the dsns are correct, actually I put the connection object into the session scope and it works fine.
I contacted Microsoft, and actually they didn't help me. The most possible thing is may be something in the servers permissions about what to accept in the Application scope.

goro
0
 

Accepted Solution

by:
sayasenh earned 150 total points
ID: 1867896
Hi,
Since a huge problem I've got suddenly concerning the global.asa I suggest this way for your .asp (if you don't have any reason for changing the default value of the pamameters -MaxBufferSize (=512), PageTimeout (=5) etc. - of course ) :

(e.g. "Forum" is the name declared in the ODBC-DSN system)
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.Open  "Forum"
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.Open "SELECT  ...etc...", Cn

And you throw the global.asa in the bin (and Frontpage as well).

I think that the plainer, the better.




0
 

Author Comment

by:goro
ID: 1867897
Ok, this is not a solution, but I already made it by myself. I think all the problems are in the permissions given to the application object.
But I'm tired of this thing, so you have your points ;-)

goro
0
 

Expert Comment

by:sayasenh
ID: 1867898
Hi,
Be careful with the global.asa system !
Anyway something escapes me : Are sure that the lines :

Set aaa = Server.CreateObject("ADODB.Connection")
                aaa.Open "DSN=MYDSN1"
are to be put in the global.asa file ?

As far as I used this solution, I put these lines in the .asp file.
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question