Error accessing database in App_Data that has linked tables from a database on another server

I have a database that lives on a Windows Server 2003 server (Server A). On another Windows 2003 server, I have my ASP.NET intranet application. In the App_Data folder of my ASP.NET application, I have a .mdb file that is basically a shell to hold links to the tables in the database file located on Server A. The reason why the master tables live in a database on Server A is because we access the data in those tables from projects outside ASP.NET, so I put the database on the server that made the most logical sense for universal access. Because I also want to access the data in those tables from my ASP.NET application, I thought I could just create the shell database in my App_Data folder and link to the tables. Unfortunately, IIS tells me that the link location cannot be found when I load the aspx page in a browser. If I open up the shell database directly and open the linked tables, they open okay, so the link location is set properly. Is IIS preventing me from loading the linked tables through ASP as a security precaution because the linked tables are not located within the App_Data folder?

How should I go about fixing this issue?

 

Thanks,

Duluter

0
duluter
1/16/2009 12:57:15 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

10 Replies
1015 Views

Similar Articles

[PageSpeed] 43
Get it on Google Play
Get it on Apple App Store

Why so complicated? Whereever your DB server is, as long as it is located in your network, you just create a connection string to the DB, then your web application anywhere can reach the DB.


"Object reference not set to an instance of an object"
0
che3358
1/16/2009 2:07:57 PM

Thanks for the response, che. What you wrote makes sense. But then, what is the point of the App_Data folder if I'm storing my database elsewhere? I read somewhere that the folder the database is stored in needs to be configured for ASP.NET. In other words, permissions need to be set for "NETWORK SERVICE" or "ASPNET" and the group needs to be given write access. I did this for my App_Data folder. If I set a connection string to a database on another server on the network that does not have ASP installed, will ASP.NET still be able to make the connection and access the data?

You can probably tell from my question how dumb I am about server administration. :)

 

Duluter

0
duluter
1/16/2009 2:30:09 PM

First, it doesn't matter whereever the DB is located, and not .NET stuff installation required. But, you need to create a connection string to get there. It is a regular way to do for ASP.NET

Second, NET 2.0 provides us a easy way to connection your data source, that is App_Data. You of course can use this feature. But, you need to create a DB source through its wizard. If you are able to use this tool to connect to your DB successfully, you should be able to get the DB. I am afraid the didn't go through the tool, and just put the file in. (Actually, the tool still will generate a connection string for you)

 


"Object reference not set to an instance of an object"
0
che3358
1/16/2009 3:41:09 PM

OK. I will try to set up a connection string to the database that resides on the separate server.

A couple of questions:

 1. When I develop, I will work with a local copy of the database on my hard drive. For this to work through a connection string on the server, I will have to modify the string to point to the folder on the server that contains the real database, correct? This is easy because all I will have to do is make one change to the connection string in the web.config file, right?

 2. I use Web Developer Express 2008. Looking at the server control code Express spit out for me, my Access data source control currently looks like this:

<asp:AccessDataSource ID="AccessDataSource1" runat="server"
        DataFile="~/App_Data/MasterReferencesLink.mdb"
        SelectCommand="SELECT...etc.">

</asp:AccessDataSource> 

 How would I modify this control code to use a connection string?

 

Thanks,

Duluter

 

 

0
duluter
1/16/2009 6:44:49 PM

duluter:

I read somewhere that the folder the database is stored in needs to be configured for ASP.NET. In other words, permissions need to be set for "NETWORK SERVICE" or "ASPNET" and the group needs to be given write access. I did this for my App_Data folder.

When you link tables, you'll still give the "NETWORK SERVICE" or "ASPNET" account the proper permissions!

0
hans_v
1/16/2009 8:07:00 PM

 hans_v:

Here's what I know. When I set the page up to access data from an mdb file in the App_Data folder that has links to tables in another database on another server on the network, I get the error described above:

"'R:\LIBRARY\MasterReferences\MasterReferences.mdb' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides."

The above path is where the main database lives on the other server. I.e., it is the path the links go to to find the referenced tables.

If, however, I delete the mdb with the linked tables out of the App_Data folder and replace it with a copy of the main database (thus, the database that my application is accessing lives entirely within App_Data and ASP.NET isn't trying to fetch data from other servers), the page loads fine.

So, when you say "when you link tables, you'll still give the NETWORK SERVICE or ASPNET account the proper permissions", I'm not sure what you mean. The linked tables version doesn't appear to work. Do I need to tweak other settings manually?

 

Ultimately, though, I'd like to take the track outlined above, wherein I do away with table linking and just reference the database in a connection string. Thus, if someone has answers to the questions in my previous post above, I'd like to hear those as well.

 

Thanks,

Duluter

 

 

0
duluter
1/17/2009 6:10:08 AM

duluter:

So, when you say "when you link tables, you'll still give the NETWORK SERVICE or ASPNET account the proper permissions", I'm not sure what you mean.

When you open a table that is linked (in you case a table in 'R:\LIBRARY\MasterReferences\MasterReferences.mdb), an ldb file needs to be created in the folder where the original mdb resides ('R:\LIBRARY\MasterReferences\), so the NETWORK SERVICE or ASPNET account also needs the proper permissions on that folder as well in order to create the ldb file.

You can try to link the tables using Database Administrator for MS Access, which is an excelent classic ASP tool to manage mdb files throegh you web brwoser, and you can also link tables with it...

0
hans_v
1/17/2009 11:25:49 AM

Let me see if I have this straight.

hans_v wrote that "When you open a table that is linked, an ldb file needs to be created in the folder where the original mdb resides ('R:\LIBRARY\MasterReferences\), so the NETWORK SERVICE or ASPNET account also needs the proper permissions on that folder as well in order to create the ldb file."

Che noted earlier that "it doesn't matter whereever the DB is located, and not .NET stuff installation required. But, you need to create a connection string to get there. It is a regular way to do for ASP.NET."

 

I have two choices:

1) create a connection string that directly accesses the database on R:\

2) Use linked tables in a shell database in the application directory.

 

Am I correct in assuming, based on hans_v's post, that no matter which decision I choose, I will need to set up the NETWORK SERVICE or ASPNET account in R:\LIBRARY\MasterReferences?

Che stated that if I use a connection string to access R:\ directly that "not .NET stuff installation required." If .NET/ IIS are not installed on R:\, then can I still create the NETWORK SERVICE or ASPNET account on R:\LIBRARY\MasterReferences?

 

Duluter

 

0
duluter
1/17/2009 3:05:19 PM

UPDATE:

I went to R:\LIBRARY\MasterReferences and added the NETWORK SERVICE group and gave it read/write permissions. I then tried opening up the page in IE and I still got an error:

 

Server Error in '/' Application.

'R:\LIBRARY\MasterReferences\MasterReferences.mdb' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

 

I'm still trying to do this through linked tables (a route I will probably end up abandoning if I can't get this working soon). From the above posts, I was under the understanding that if I set up NETWORK SERVICE on R:\LIBRARY\MasterReferences, then my ASP.NET application would be able to access the data in that folder.

 

Before I can successfully access the database through ASP, do I need to reboot the R:\ server? Or is there another issue at work here?

 

Duluter

0
duluter
1/17/2009 5:57:47 PM

duluter:

Am I correct in assuming, based on hans_v's post, that no matter which decision I choose, I will need to set up the NETWORK SERVICE or ASPNET account in R:\LIBRARY\MasterReferences?

yes, that's right.

Maybe this will help

0
hans_v
1/17/2009 7:08:31 PM
Reply:

Similar Artilces:

Error 7405 accessing SQL Server database by database link
I'm persistently getting the above error when executing a stored procedure that uses a dabase link to another SQL Server database. I can run the procedure in MS SQL Server management studio fine. I'm setting ANSI_NULLS and ANSI_WARNINGS ON before creating the procedure. Procedure code: SET ANSI_NULLS ON SET ANSI_WARNINGS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[SSP_WAR_RPT_MANUAL_RECLAIM] @adt_sbi_from datetime, @adt_sbi_to datetime, @as_vendor varchar(15) output, @as_campaigns Char(1) AS BEGIN SET ANSI_NULLS O...

Link FoxPro Database table to SQL Server Database table
I have LAN Server in witch Visual Foxpro Database reside.I have another remote server in witch SQL Server 2005 installed.I want to link Foxpro table to SQL Server Database Table.Is it possible? Can please someone help? Thanks MS...

New errors access MS SQL Server Database on (CREATE DATABASE and Batch SQL Statement)
------=_NextPart_000_002B_01C2F2CB.0C201FF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm running ActiveState perl 5.8.0 on a WIN2K box with MS SQL Server = 2000. Recently I updated DBD-ODBC to v1.05 and DBI to v1.35 Now I get the following errors executing some sql commands CREATE SQLSTMT:[CREATE DATABASE POMS_SER ON (NAME =3D 'POMS_SER_DAT', = FILENAME =3D 'd:\Database\POMS\POMS_SER_Data.MDF', SIZE =3D 10MB) LOG ON = ( NAME =3D 'POMS_SER_LOG', FILENAME =3D = 'd:\Database\POMS\POMS_S...

Copying Database table to another Database
I am using Visual Studio 2005 to connect to a database on a remote SQL2000 server.  I need to copy a table in a database on my local machine up to the server.  How can I do that? Thank you, Do you have enterprise manager or sql management studio?If so do use the Import/Export wizard to copy the table from A to B. -- Sam Critchley"Wise man say 'forgiveness is divine, but never pay full price for late pizza." - TMNTshivam.com.au no - I have Access 2007 and it is nothing like Access 2000 which made this act easy   Part of my problem is that I am using V...

copy of table from another database into your database
We copy a table from a progress database into our sql server database that we use as a read-only table.  We perform this action through a job. Is there a way to have a read only table from another database that is put into your database that will always be insinc with the original copy to use as a read only copy, that as the original table is updated, it will proprogate to your copied table? Would setting up a package to import the data from the other database on a schedule work?  In SQL Server, you can do an import and you have the option to save the import as a package and sch...

Access Database and SQL Server database
Hi, I have an access database server and a sql server DB. The  Structure of both DB is same . The data is updated or inserted in access DB. I want to update SQL Server DB on a any event say button click. All updated data or new data in access DB should be reflected on SQL Server DB . Can anyone guide on the approach to be attempted. Thanks   Mark this as an answer if you find my it helpful.Thanks,Anubhuti ONe approach would be to use the System.Data.OleDb library and store connection strings for each database in your web.config file.  Each time you need ...

MS Access Database on NW6.5 Server: Can't refresh linked tables
Hello everybody, I got a strange problem concerning MS Access 2000 Databases on a Novell NetWare Server after upgrading the Server from NW5.1 to NW6.5 and the Novell Clients from 4.83SP1 to 4.9SP2 (on an Windows NT4.0 SP6 Workstation). When I start Database 1 from a mapped drive on my Workstation and try to refresh the linked tables to Database 2 (that resides in the same folder on the NetWare Server), I get an error message from the Jet Database Engine that the tables could not be found. When I delete the linked tables in DB1 and try to re-add them (using the Linked Table ...

Update table error when table located in another database
Hi, Since upgrading to PB11 I am having problems updating tables on joined databases using sql server. An example select statement is SELECT * FROM Northwind.dbo.Region and my update table is defined as Northwind.dbo.Region However when I try to update the datawindow I get an error stating invalid object and displaying the update statement of UPDATE "Northwind"."dbo.Region" SET "regiondescription" = ? WHERE "regionid" = ? . I've had to set a identifier quote in the connection object as we have some columns that are reserved wor...

Server-Upgrade to NW6.5: Can't refresh linked tables in MS Access Database
Hello everybody, I got a strange problem concerning MS Access 2000 Databases on a Novell NetWare Server after upgrading the Server from NW5.1 to NW6.5 and the Novell Clients from 4.83SP1 to 4.9SP2 (on an Windows NT4.0 SP6 Workstation). When I start Database 1 from a mapped drive on my Workstation and try to refresh the linked tables to Database 2 (that resides in the same folder on the NetWare Server), I get an error message from the Jet Database Engine that the tables could not be found. When I delete the linked tables in DB1 and try to re-add them (using the Linked Table Manager...

Converting Access database to the Sql Server database
how can I convert or transfer my Access database to SQl Server database ? Thanks in advance.HighOnCodingWanna get high! Try "the Upsizing wizard". Look in Access help...

updating Sql database from linked Access database
I got thrown into a new project that is going to require me to update an SQL server database tables from an Access table on the backend of an Oracle database on another server. At the end of each day the Access dabase will be updated from the Oracle database. What I need to do, is when the Access database is updated I need to have the table in the SQL database automaticaly updated. When a new record is added to the Access table I need the new record added to the SQL table. When a record is deleted in the Access table I need to keep that record in the SQL table and set a field to a value (...

Table transfer from one Database to another Database
Hi,I want to transfer one table to transfer another table using dataset and writing ASP.NET code, tables are in different databases, and databases are in different servers. I wrote the following code, the second table is empty initially; public DataSet DS1;public DataSet DS2;public SqlDataAdapter DA2; private void Page_Load(object sender, System.EventArgs e){ // get dataset from database1 and display in gridSqlConnection conn1 = new SqlConnection("server=(local);database=;Uid=;password="); String strSQL1 = "select * from myTable1"; SqlDataAdapter DA1 = new SqlDataAdapter(strSQL1,conn1...

Database Error ; Database Server Keeps Shutting Down
I am receiving the following error in my error log. My database then shuts down. What could be causing this error? Checkpoint log: write to D:\Sys_Editor\Sys_Editor.db failed with status 1453: filesystem may be full or file size has exceeded system limits What is the Operating System? What is the version of SQL Anywhere? Have you confirmed that the filesystem is not full? Herman Strdivant wrote: > I am receiving the following error in my error log. My > database then shuts down. What could be causing this error? > > Checkpoint log: write to D:\Sys_Editor\Sys_Edit...

Thoughts on Linking Membership Database to Another Database
Hello, I have a general question I would like to pose. I think the login controls for ASP.NET 2.0 will work with our application.  However, we contain a ton of customer information that obviously the membership & roles database doesn't handle. My question is, do you think it is possible to contain the login information in the membership database, while then linking back somehow to our customer database (which is a separate SQL application)?And, if you think it's possible, how would you recommend going about it.Thanks in advance.  You can do it by writing your own me...

Web resources about - Error accessing database in App_Data that has linked tables from a database on another server - asp.net.config-deploy

Highest Percentage Of Opera Mini Users Accessing Facebook? Macau
If you were asked to guess which country had the highest percentage of users of Opera mobile Web browser Opera Mini users accessing Facebook ...

International Users Accessing Facebook Places Through US VPN Accounts
By using a virtual private network (VPN) hosted in the United States, Facebook users from around the world are accessing Facebook Places. The ...

What are some alternatives to Yodlee for accessing bank information?
Clay Loveless , Founder, Jexy. Co-founder, Mashery. Founder, Jexy. Co-founder, Mashery.

Cloud Console - Accessing files in cloud storage for iPad on the iTunes App Store
Get Cloud Console - Accessing files in cloud storage on the App Store. See screenshots and ratings, and read customer reviews.

Meryl Streep On Accessing The Characters Within - YouTube
Meryl Streep talks about the importance of an actors work representing their ability. CONNECT WITH AFI: http://facebook.com/AmericanFilmInstitute ...

Accessing the Future Fund a sensible proposal, says super expert Daryl Dixon
As portfolios go, the Future Fund's asset allocation is concentrated in higher-risk investment, including equities and alternative assets.

Accessing my Super
I'm 57 - can I access my super?

Australia, US accessing Indonesian telephone data, leaked documents show
Newly disclosed documents from former US intelligence contractor Edward Snowden have revealed that Australian intelligence efforts against Indonesia ...

Euthanasia advocate Philip Nitschke detained at Melbourne Airport, accuses Customs officials of accessing ...
Euthanasia advocate Philip Nitschke has accused Customs officials of accessing hundreds of patients' sensitive records on his laptop after detaining ...

Frances Abbott scholarship: Sydney woman pleads guilty to accessing Whitehouse Institute records on PM's ...
A Sydney woman who leaked the student records of Tony Abbott's daughter pleads guilty. A Sydney woman who leaked the student records of Prime ...

Resources last updated: 12/29/2015 12:42:40 PM