473,548 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jet database access problem from web service

Hello,

I have trouble connecting to Access database from my web service. Database
is located in a subdirectory of where service pages are. Code below produces
the following exception: "No error information available - E_NOINTERFACE".

[WebMethod(Descr iption = "This method tests connection",
EnableSession = true,
TransactionOpti on=TransactionO ption.RequiresN ew)]
public bool TestConnection( )
{
// Get connection string from web.config
string strConnection =
ConfigurationSe ttings.AppSetti ngs.Get("Connec tionString");
// Here's actual connection string
// "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=c:\WebSe rviceLocation\D ata\Data.mdb;Je t OLEDB:Database
Password=testpa ssword"
string username =
System.Security .Principal.Wind owsIdentity.Get Current().Name;

if (strConnection == null)
return false;

OleDbConnection conn = new OleDbConnection (strConnection) ;
try
{
conn.Open();
return true;
}
catch(Exception exc)
{
return false;
}
finally
{
conn.Close();
}
}

I tried a number of permission changes. I granted ASPNET account full
permissions into the directory where database is located; I granted
IUSR_MachineNam e account the same set of permissions; I tried impersonating a
normal user who has full permissions over Data directory; tried having Asp
process run under System account by modifying Machine.config. None of these
work and I always get the E_NOINTERFACE. (I did check this code out of
regular WinForms app and it works just fine).

I also tried an Odbc connection with with the follwoing string:
@"Driver={Micro soft Access Driver
(*.mdb)};Dbq=c: \WebServiceLoca tion\Data\Data. mdb;Uid=Admin;P wd=testpassword "
That gets me the following error:
"ERROR [25000] [Microsoft][ODBC Driver Manager] Failed to enlist on calling
object's transaction\r\n ERROR [IM006] [Microsoft][ODBC Driver Manager]
Driver's SQLSetConnectAt tr failed"

I am at a loss as to what to do. Any suggestions will be greatly appreciated.

Sonya
Nov 18 '05 #1
1 2341
Hey folks,

Dunno if anyone cares, but I found the problem. In the Webmethod attribute,
there is a named parameter TransactionOpti on=TransactionO ption.RequiresN ew.
Well, seeing as Access doesn't suport transactions, it was killing even the
connection. Having removed that, everything works.

Sonya

"Sonya" wrote:
Hello,

I have trouble connecting to Access database from my web service. Database
is located in a subdirectory of where service pages are. Code below produces
the following exception: "No error information available - E_NOINTERFACE".

[WebMethod(Descr iption = "This method tests connection",
EnableSession = true,
TransactionOpti on=TransactionO ption.RequiresN ew)]
public bool TestConnection( )
{
// Get connection string from web.config
string strConnection =
ConfigurationSe ttings.AppSetti ngs.Get("Connec tionString");
// Here's actual connection string
// "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=c:\WebSe rviceLocation\D ata\Data.mdb;Je t OLEDB:Database
Password=testpa ssword"
string username =
System.Security .Principal.Wind owsIdentity.Get Current().Name;

if (strConnection == null)
return false;

OleDbConnection conn = new OleDbConnection (strConnection) ;
try
{
conn.Open();
return true;
}
catch(Exception exc)
{
return false;
}
finally
{
conn.Close();
}
}

I tried a number of permission changes. I granted ASPNET account full
permissions into the directory where database is located; I granted
IUSR_MachineNam e account the same set of permissions; I tried impersonating a
normal user who has full permissions over Data directory; tried having Asp
process run under System account by modifying Machine.config. None of these
work and I always get the E_NOINTERFACE. (I did check this code out of
regular WinForms app and it works just fine).

I also tried an Odbc connection with with the follwoing string:
@"Driver={Micro soft Access Driver
(*.mdb)};Dbq=c: \WebServiceLoca tion\Data\Data. mdb;Uid=Admin;P wd=testpassword "
That gets me the following error:
"ERROR [25000] [Microsoft][ODBC Driver Manager] Failed to enlist on calling
object's transaction\r\n ERROR [IM006] [Microsoft][ODBC Driver Manager]
Driver's SQLSetConnectAt tr failed"

I am at a loss as to what to do. Any suggestions will be greatly appreciated.

Sonya

Nov 18 '05 #2

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

Similar topics

4
5483
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP applied some sort of extra security arrangements to their SQL Server to allow access only through port 1433. they have told me to configure an alias...
2
2675
by: Robert McGregor | last post by:
Hi all, I've got a Front End / Back End database that was working just fine. One day i opened the FE to find that if I tried to open one of the linked tables from the database window, nothing happened (hourglass for about 2 seconds then nothing). I tried relinking the tables and got the same response. (Access even completely bombed out...
2
1410
by: jfathman | last post by:
Hello, We are considering a project that requires implementing a database (Windows PC based) that would be shared by a small number of users. The database would store events output by our networking device, and any of the users could generate reports based on the stored event data. This would be for small, low-cost systems, not large...
6
4332
by: Jeff | last post by:
Has anyone had any luck accessing an Oracle database from a web service? I have a C# DLL with various code to query an Oracle database. If I call the methods in this DLL from a Windows Forms application everything works just fine. However, if I call the methods in this DLL from a web service, I receive the following error when the database...
4
16790
by: Bob Sanderson | last post by:
I am trying to set up an ODBC DSN to our company MySQL database so that I can use a MS Access front end. I am using the MySQL ODBC 3.51 driver. The database is running off of Apache on our Windows 2000 server (call it 'foobar'). The host is 'localhost', the user is 'root'. To access the database via a web browser on a PC on our network, I use...
1
7171
by: =?Utf-8?B?TmVsc29uIEFuZHLDqQ==?= | last post by:
Dear friends, I'm a Web Services newbie and I have created a simple Web Service that given 3 parameters accesses a database and returns 1 value. When run from Visual Studio 2005, the Webservice returns the correct information from the database with no problems. I have created a new Virtual Directory in my local IIS that points to the VS2005...
5
2326
by: war_wheelan | last post by:
I created the db with the attached script and I am able to access it until I reboot the server. I've tried enabling flag 1807 via the SQL server service and the startup parameters of the instance. In all cases the database always come up suspect after a reboot. There was one instance where I was able to recover, but I am not sure how that...
5
14258
by: Gav | last post by:
I'm writing a windows application (using C# VS 2005 Pro) to access a MS SQL database and although it is working fine (up to now) I'm not sure I'm going about it in the best way. Can anybody point me to any good examples online that i can look at, found loads of web applications but struggling to find a good windows application example. ...
6
1702
by: =?Utf-8?B?UGFycm90?= | last post by:
I cannot access my SQL database in a browser control created in my C# Windows application program I can, however, access the database from an IE browser. I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE" error message. I researched all the advice on the internet and tried to add an NT AUTHORITY\NETWORK SERVICE login to my...
0
7512
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7438
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6036
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.