473,383 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

connection to MS Access

Hi guys,

Im attempting to connect my asp.net solution to an ms access backend
database.

Everything is working fine locally but when i upload i get the error
"exception has been thrown by the target of the invocation" my first
instinct is that this is a permissions issue but i dont have access to
the server and ive been told that all permissions are fine.

Can permissions be reset automatically on the server after i FTP the
site ????

If this isnt a permissions issue would it be a path name issue ??

im a bit confused as to what slash convention to use in the path. i use
something like server.mappath("/database/db.mdb") e.g. "/" or "\" -
can someone give me some assistance with this as im a bit stuck.

thanks

Nov 19 '05 #1
4 1108
On 12 Oct 2005 06:08:42 -0700, "csgraham74" <cs********@gmail.com> wrote:

¤ Hi guys,
¤
¤ Im attempting to connect my asp.net solution to an ms access backend
¤ database.
¤
¤ Everything is working fine locally but when i upload i get the error
¤ "exception has been thrown by the target of the invocation" my first
¤ instinct is that this is a permissions issue but i dont have access to
¤ the server and ive been told that all permissions are fine.
¤
¤ Can permissions be reset automatically on the server after i FTP the
¤ site ????
¤
¤ If this isnt a permissions issue would it be a path name issue ??
¤
¤ im a bit confused as to what slash convention to use in the path. i use
¤ something like server.mappath("/database/db.mdb") e.g. "/" or "\" -
¤ can someone give me some assistance with this as im a bit stuck.

Can you determine what the line of code is that is generating the error?

Also, what level of authentication is your web application configured for?
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 19 '05 #2
yeah it on my connection.open () line of code therefore im thinking
that its my database which is causing the problem.

I dont have any levels of authentication in my system ?? should i
introduce this ?

what does it do ???

Nov 19 '05 #3
> Everything is working fine locally but when i upload i get the error
"exception has been thrown by the target of the invocation" my first
instinct is that this is a permissions issue but i dont have access to
the server and ive been told that all permissions are fine.
Your methodology scares the heck out of me!

Based on the (lack of) information you posted, I can give you some general
principles to identify, diagnose, and prevent such exceptions from
occurring:

1. Murphy is your constant companion. Trust no one, especially yourself.
The worst tester of an application is the developer. Just because you
made it work on your dev machine doesn't mean it has no bugs!

You know what your app should do, and are likely to make it do
just that. You have only worked with it on your development machine.
Your development machine is not a live server, much less one
that is hosted by strangers in another part of the world.

2. Your first step to correcting the problem is to locate the point where
it occurred, which Page, what class, what line of code.
Your instincts are not reliable. Trust no one, especially yourself.
There are hundreds of things that can go wrong in an ASP.Net
application. Guessing, especially based on "instinct" is about the
worst possible way to identify the problem.

Keeping point 1 in mind, expecting things to go wrong, use structured
exception handling (try/catch). At the very least, the page itself
ought to be able to give you some information about what went wrong
when it does. Logging is a good thing, but on a hosted server, the
best you may be able to hope for is a detailed error message on the
page, including a Stack Trace, which is a property of the
Exception class.

Tracing is often helpful in determining the cause of a problem.
Try using that if possible.

3. Once the point of failure is identified, an analysis of what caused
the problem is in order. Exceptions are often passed "up the food
chain," and the cause may not actually be in the line of code that is
identified in an error message (if it is). This is where the stack trace
can come in handy. It will show you the stack of instructions that
the exception bubbled up through. The trace does much the same
thing, but with less accuracy.

4. Different types of Exception classes contain different sorts of
information in them. You can use multiple Catch statements to
catch more specific types of exceptions, and extract more
information about the problem from that information. Some
Exceptions contain InnerExceptions as well. The InnerException
is the real thing, if it is present.

5. Here's where your study of what you're using, and the .Net
Framework SDK can come in handy. You need to identify the
mistake you made. Often, this can only be achieved by a
painfully detailed examination of your code. If you did a good
job of tracking the exception down, this will be easier.

6. Once corrected, and re-tested, expect more to come. After
all, Murphy is your constant companion!

7. An after-action review of your methodology will help you
prevent similar such errors from occurring in the future.
What made you screw up? Did you simply overlook a
possibility? Did you rely too much on your tools to do the
heavy lifting for you? Are you getting enough sleep lately?

8. A measure of paranoia is often a programmer's best friend!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"csgraham74" <cs********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... Hi guys,

Im attempting to connect my asp.net solution to an ms access backend
database.

Everything is working fine locally but when i upload i get the error
"exception has been thrown by the target of the invocation" my first
instinct is that this is a permissions issue but i dont have access to
the server and ive been told that all permissions are fine.

Can permissions be reset automatically on the server after i FTP the
site ????

If this isnt a permissions issue would it be a path name issue ??

im a bit confused as to what slash convention to use in the path. i use
something like server.mappath("/database/db.mdb") e.g. "/" or "\" -
can someone give me some assistance with this as im a bit stuck.

thanks

Nov 19 '05 #4
On 12 Oct 2005 07:53:12 -0700, "csgraham74" <cs********@gmail.com> wrote:

¤ yeah it on my connection.open () line of code therefore im thinking
¤ that its my database which is causing the problem.
¤
¤ I dont have any levels of authentication in my system ?? should i
¤ introduce this ?
¤
¤ what does it do ???

Well yes, your application will be configured for some level of authentication in IIS, probably
Anonymous and Integrated Windows if it hasn't been changed. In any event, if you haven't enabled
impersonation then your ASP.NET app is probably running under the ASPNET identity (NetworkService
under Windows 2003 Server).

In order for your ASP.NET application to have complete access to this file the ASPNET account must
have full permissions to the folder where the file is located. See the following for more
information:

PRB: Cannot connect to Access database from ASP.NET
http://support.microsoft.com/default...b;en-us;316675
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
6
by: jonefer | last post by:
I have two versions of a 'Downtime Application that will run in the event that the mainframe goes down 1) SQL Server ASP.NET app (accessed outside the mainframe network) 2) MS Access Version of...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
1
by: =?Utf-8?B?VmVua2F0ZXNhbiBT?= | last post by:
Hi, I have a requirement of consuming a connection object returned from a COM component deployed in COM+ application. I have given the need for this requirement end of my query. My component...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.