I'm trying to move a asp.net website to a new site hosted by Godaddy.com.
When I try to browse and aspx page with ADO in it, I get:

Parser Error Message: The current trust level does not allow use of the
'AspCompat' attribute

Source Error:

Line 29: </head>
Line 30:
Line 31: <%@ Page language="VB" Debug="true" aspcompat="True" %>


Godaddy said on the phone they don't allow aspcompat="True". I assume I need
it for the code that says:

sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
Cnxn = Server.CreateObject("ADODB.Connection")
Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
Info=TRUE;" & "Data Source=" & sPath, "Admin", "")

What are the options? Is there another line of code I can add to make it
work somehow?

TIA

RE: 'AspCompat' attribute not allowed by pbromberg

pbromberg
Fri Mar 14 20:15:00 CDT 2008

GoDaddy.com is notorious for the ridiculous and inappropriate restrictions
they put on hosted sites. I once started a site with them and it wouldn't
even allow an outbound HttpWebRequest. They never disclose ANY of this
information up front - you have to find out "after the fact".
My advice? Find another hosting company right away and cut your losses.

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


"Jonathan" wrote:

> I'm trying to move a asp.net website to a new site hosted by Godaddy.com.
> When I try to browse and aspx page with ADO in it, I get:
>
> Parser Error Message: The current trust level does not allow use of the
> 'AspCompat' attribute
>
> Source Error:
>
> Line 29: </head>
> Line 30:
> Line 31: <%@ Page language="VB" Debug="true" aspcompat="True" %>
>
>
> Godaddy said on the phone they don't allow aspcompat="True". I assume I need
> it for the code that says:
>
> sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
> Cnxn = Server.CreateObject("ADODB.Connection")
> Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
> Info=TRUE;" & "Data Source=" & sPath, "Admin", "")
>
> What are the options? Is there another line of code I can add to make it
> work somehow?
>
> TIA
>
>
>
>

Re: 'AspCompat' attribute not allowed by Rick

Rick
Sat Mar 15 15:05:24 CDT 2008

Peter's right - run away from GoDaddy if you think you have any code that
requires security settings. They are horribly inflexible and will not work
with you to get security issues resolved.

However your particular problem is due to using COM for ADO data access. You
can change your code to use ADO.NET instead and use the ADO.NET OleDb
provider instead. It will require code changes.

I assume you're migrating some older ASP classic code if you're using the
COM ADO classes. If rewriting for ADO.NET is not an option you'd probably be
much better off using classic ASP which will perfom better with the COM
objects than ADO.NET will and would let you get around the security issues.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com/weblog


"Jonathan" <none@none.com> wrote in message
news:eo0wgUjhIHA.5204@TK2MSFTNGP02.phx.gbl...
> I'm trying to move a asp.net website to a new site hosted by Godaddy.com.
> When I try to browse and aspx page with ADO in it, I get:
>
> Parser Error Message: The current trust level does not allow use of the
> 'AspCompat' attribute
>
> Source Error:
>
> Line 29: </head>
> Line 30:
> Line 31: <%@ Page language="VB" Debug="true" aspcompat="True" %>
>
>
> Godaddy said on the phone they don't allow aspcompat="True". I assume I
> need
> it for the code that says:
>
> sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
> Cnxn = Server.CreateObject("ADODB.Connection")
> Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
> Info=TRUE;" & "Data Source=" & sPath, "Admin", "")
>
> What are the options? Is there another line of code I can add to make it
> work somehow?
>
> TIA
>
>
>


RE: 'AspCompat' attribute not allowed by stcheng

stcheng
Sun Mar 16 21:21:35 CDT 2008

Hi Jonathan,

Yes, as other members have suggested, the error is due to the current .NET
Code access security level of your ASP.NET application is restricted and
does not allow you to use "AspCompat" attribute on aspx page. This is a
common problem when you host page in a publish web hoster. If the webhoster
will not allow elevated code access security, I'm afraid you may consider
migrating those ASPCOMPAT page's code to .NET code so as to avoid the
problem.

Here are some reference about Code Access Security and ASP.NET:

#How To: Use Code Access Security in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/ms998326.aspx

#ASP.NET Code Access Security
http://msdn2.microsoft.com/en-us/library/87x8e4d1.aspx

Hope also helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Jonathan" <none@none.com>
>Subject: 'AspCompat' attribute not allowed
>Date: Sat, 15 Mar 2008 13:37:31 +1300

>
>I'm trying to move a asp.net website to a new site hosted by Godaddy.com.
>When I try to browse and aspx page with ADO in it, I get:
>
>Parser Error Message: The current trust level does not allow use of the
>'AspCompat' attribute
>
>Source Error:
>
>Line 29: </head>
>Line 30:
>Line 31: <%@ Page language="VB" Debug="true" aspcompat="True" %>
>
>
>Godaddy said on the phone they don't allow aspcompat="True". I assume I
need
>it for the code that says:
>
>sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
>Cnxn = Server.CreateObject("ADODB.Connection")
>Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
>Info=TRUE;" & "Data Source=" & sPath, "Admin", "")
>
>What are the options? Is there another line of code I can add to make it
>work somehow?
>
>TIA
>
>
>
>


Re: 'AspCompat' attribute not allowed by Jonathan

Jonathan
Sun Mar 16 11:29:56 CDT 2008

Thanks.

When you say "It will require code changes", I wonder if you can help me
identify them? This is what I have:

<%@ Page language="VB" Debug="true" aspcompat="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
Cnxn = Server.CreateObject("ADODB.Connection")
Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
Info=TRUE;" & "Data Source=" & sPath, "Admin", "")

rs = server.createobject("adodb.recordset")
rs.open(strSQLChange, Cnxn, 2, 2)

If rs.EOF Then 'No records
bolLoggedIn = False
Else
bolLoggedIn = True
strCookieFirstName = rs("UserFirstName").Value
strCookieLastName = rs("UserLastName").Value
strLoggedInEmailAddress = strEmailAddress
End If

rs.Close
rs = Nothing
Cnxn.Close
Cnxn = Nothing



"Rick Strahl" <rickstrahl@hotmail.com> wrote in message
news:EA7487C2-9F96-49C6-A078-98815C7B0F8D@microsoft.com...
> Peter's right - run away from GoDaddy if you think you have any code that
> requires security settings. They are horribly inflexible and will not work
> with you to get security issues resolved.
>
> However your particular problem is due to using COM for ADO data access.
You
> can change your code to use ADO.NET instead and use the ADO.NET OleDb
> provider instead. It will require code changes.
>
> I assume you're migrating some older ASP classic code if you're using the
> COM ADO classes. If rewriting for ADO.NET is not an option you'd probably
be
> much better off using classic ASP which will perfom better with the COM
> objects than ADO.NET will and would let you get around the security
issues.
>
> +++ Rick ---
>
> --
>
> Rick Strahl
> West Wind Technologies
> www.west-wind.com/weblog
>
>
> "Jonathan" <none@none.com> wrote in message
> news:eo0wgUjhIHA.5204@TK2MSFTNGP02.phx.gbl...
> > I'm trying to move a asp.net website to a new site hosted by
Godaddy.com.
> > When I try to browse and aspx page with ADO in it, I get:
> >
> > Parser Error Message: The current trust level does not allow use of the
> > 'AspCompat' attribute
> >
> > Source Error:
> >
> > Line 29: </head>
> > Line 30:
> > Line 31: <%@ Page language="VB" Debug="true" aspcompat="True" %>
> >
> >
> > Godaddy said on the phone they don't allow aspcompat="True". I assume I
> > need
> > it for the code that says:
> >
> > sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
> > Cnxn = Server.CreateObject("ADODB.Connection")
> > Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
> > Info=TRUE;" & "Data Source=" & sPath, "Admin", "")
> >
> > What are the options? Is there another line of code I can add to make it
> > work somehow?
> >
> > TIA
> >
> >
> >
>



Re: 'AspCompat' attribute not allowed by stcheng

stcheng
Mon Mar 17 20:37:25 CDT 2008

Hi Jonathan,

From the code you provided, you're still using the VB6 ADO objects to
connect access database. In .net framework you can use the new OleDb
provider:

#Walkthrough: Editing an Access Database with ADO.NET
http://msdn2.microsoft.com/en-us/library/ms971485.aspx

However, as far as I know, OleDBProvider also require Full permission trust
level (for CAS settings), mentioned in the article I mentioned earlier:

#How To: Use Code Access Security in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/ms998326.aspx

therefore, I'm afraid the host provider's policy restriction become the
main bottleneck here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: "Jonathan" <none@none.com>
>References: <eo0wgUjhIHA.5204@TK2MSFTNGP02.phx.gbl>
<EA7487C2-9F96-49C6-A078-98815C7B0F8D@microsoft.com>
>Subject: Re: 'AspCompat' attribute not allowed
>Date: Mon, 17 Mar 2008 04:29:56 +1200

>Thanks.
>
>When you say "It will require code changes", I wonder if you can help me
>identify them? This is what I have:
>
><%@ Page language="VB" Debug="true" aspcompat="True" %>
><%@ Import Namespace="System.Data" %>
><%@ Import Namespace="System.Data.OleDb" %>
>
>sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
>Cnxn = Server.CreateObject("ADODB.Connection")
>Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
>Info=TRUE;" & "Data Source=" & sPath, "Admin", "")
>
> rs = server.createobject("adodb.recordset")
> rs.open(strSQLChange, Cnxn, 2, 2)
>
> If rs.EOF Then 'No records
> bolLoggedIn = False
> Else
> bolLoggedIn = True
> strCookieFirstName = rs("UserFirstName").Value
> strCookieLastName = rs("UserLastName").Value
> strLoggedInEmailAddress = strEmailAddress
> End If
>
> rs.Close
> rs = Nothing
> Cnxn.Close
> Cnxn = Nothing
>
>
>
>"Rick Strahl" <rickstrahl@hotmail.com> wrote in message
>news:EA7487C2-9F96-49C6-A078-98815C7B0F8D@microsoft.com...
>> Peter's right - run away from GoDaddy if you think you have any code that
>> requires security settings. They are horribly inflexible and will not
work
>> with you to get security issues resolved.
>>
>> However your particular problem is due to using COM for ADO data access.
>You
>> can change your code to use ADO.NET instead and use the ADO.NET OleDb
>> provider instead. It will require code changes.
>>
>> I assume you're migrating some older ASP classic code if you're using the
>> COM ADO classes. If rewriting for ADO.NET is not an option you'd probably
>be
>> much better off using classic ASP which will perfom better with the COM
>> objects than ADO.NET will and would let you get around the security
>issues.
>>
>> +++ Rick ---
>>
>> --
>>
>> Rick Strahl
>> West Wind Technologies
>> www.west-wind.com/weblog
>>
>>
>> "Jonathan" <none@none.com> wrote in message
>> news:eo0wgUjhIHA.5204@TK2MSFTNGP02.phx.gbl...
>> > I'm trying to move a asp.net website to a new site hosted by
>Godaddy.com.
>> > When I try to browse and aspx page with ADO in it, I get:
>> >
>> > Parser Error Message: The current trust level does not allow use of the
>> > 'AspCompat' attribute
>> >
>> > Source Error:
>> >
>> > Line 29: </head>
>> > Line 30:
>> > Line 31: <%@ Page language="VB" Debug="true" aspcompat="True" %>
>> >
>> >
>> > Godaddy said on the phone they don't allow aspcompat="True". I assume I
>> > need
>> > it for the code that says:
>> >
>> > sPath = "D:\inetpub\www\myuser\fpdb\db.mdb"
>> > Cnxn = Server.CreateObject("ADODB.Connection")
>> > Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
>> > Info=TRUE;" & "Data Source=" & sPath, "Admin", "")
>> >
>> > What are the options? Is there another line of code I can add to make
it
>> > work somehow?
>> >
>> > TIA
>> >
>> >
>> >
>>
>
>
>