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:
(E-Mail Removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Jonathan" <(E-Mail Removed)>
>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
>
>
>
>