Last post Jan 31, 2009 06:08 AM by vin_vinojo
Oct 25, 2007 11:21 AM|oscarpn|LINK
I'm trying just to connect some ASP.NET 2 pages to MDB database, but the server doesn't recoignize file path or file dsn.
Please anyone knows how to connect MS Access using ASP.Net on Godaddy??
Error when I try file dsn or direct mdb file connection:
System.FieldAccessException: Attempted to access a field that is not accessible by the caller
Using FILE DSN:
<add name="cnAutoRent" connectionString="filedsn=d:\hosting\mydomain\_dsn\access_auto.dsn;pwd=PWD;uid=USER" providerName="System.Data.Odbc" />
Using MDB FILE:
<add name="cnAutoRent" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/hosting/mydomain/access_db/auto.mdb" providerName="System.Data.OleDb" />
mdb godaddy asp.net web.config
Oct 25, 2007 11:59 AM|hans_v|LINK
Place the database in the App_Data folder:
connectiionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|auto.mdb"
Oct 25, 2007 01:30 PM|oscarpn|LINK
I try changing and copy .mdb file to /App_data directory... but still the same problem
Exception Details: System.FieldAccessException: Attempted to access a field that is not accessible by the caller.
Oct 25, 2007 03:44 PM|Mikesdotnetting|LINK
The error you are getting has nothing to do with databases.
Can you show the actual line of code that throws this error? Also, although not related to the problem, never use DSNs with Access. Always use the Jet OleDb provider.
Oct 25, 2007 05:58 PM|oscarpn|LINK
I found the solution, this is not a file access or database exception.
GoDaddy is medium trust host, and dont accept some components (like MagicAjax)
When I remove MagicAjax references, everything works fine.
Jan 31, 2009 06:08 AM|vin_vinojo|LINK
Thanks it worked for me.