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
>> >
>> >
>> >
>>
>
>
>