Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 5th, 2010, 06:16 AM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Cool "Could not delete from specified tables."

Greetings everyone!

First of all, please excuse me if this is not the appropriate forum, or if this post is not complete with debug information. I'm a PHP programmer, and not used with .NET at all, but I have a project to debug a companys administrative part of their website.


Here comes the error message:
Server Error in '/' Application.

Could not delete from specified tables.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Could not delete from specified tables.

Source Error:
Code:

Code:
Line 22:             //oDel.DeletePictures();
Line 23: 
Line 24:             Offer.Del(Convert.ToInt32(Request.QueryString["ID"]));
Line 25:             Response.Redirect("~/admin/ErbjudandeEdit.aspx?action=view");   
Line 26:         }


Source File: d:\customers\njutagotland.se\wwwroot\admin\uc\Offe rs.ascx.cs Line: 24

Stack Trace:
Code:

Code:
[OleDbException (0x80004005): Could not delete from specified tables.]
   Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +202
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) +150
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) +178
   Mecs.DataAccess.DB.Exec(String execString) +93
   Mecs.BaseObject`1.Del(T objBaseObject) +80
   Mecs.BaseObject`1.Del(Int32 Pk1Val) +130
   admin_uc_Offers.Page_Load(Object sender, EventArgs e) in d:\customers\njutagotland.se\wwwroot\admin\uc\Offers.ascx.cs:24
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


The company have a similar website up and running already, they were launching a similar project on another location so I basicly just copied the website and put it on the new server. First it didn't work, so I edited a "web.config" file and set some paths etc to the new ones, so the website and database worked fine in front-end mode (read). What does not work is the administrative part. I can't add, edit or delete partners/news/etc. Since read is standard, but edit is not I figured I need to set some privileges/rights.

What I know of .NET is that it uses tons of files and files only. The database is a .mdb (Microsoft Access?), so my suggestion is that the server does not allow the script to edit the database file. Could anyone help me please?

PS. If you need any further information, please let me know.

* I forgot to add, if I'm right above, is it possible to fix this without having server access? I only have FTP access, already tried to chmod the database files with no success.

Kind Regards,
Andreas.

Last edited by Valore; May 5th, 2010 at 06:27 AM..
  #2 (permalink)  
Old May 5th, 2010, 06:40 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

This appears to be an Access database issue, and not related to the ASP.Net code, although its hard to be definite about that.

You'd need to know exactly what SQL your data access layer is trying to execute, and then try and work out why that isn't working.

A google of the error "Could not delete from specified tables." reveals lots of issues with deleting from multiple tables, but I don't know how that would affect you.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
  #3 (permalink)  
Old May 5th, 2010, 06:47 AM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by samjudson View Post
This appears to be an Access database issue, and not related to the ASP.Net code, although its hard to be definite about that.

You'd need to know exactly what SQL your data access layer is trying to execute, and then try and work out why that isn't working.

A google of the error "Could not delete from specified tables." reveals lots of issues with deleting from multiple tables, but I don't know how that would affect you.
Thanks for your quick answer. I've tried searching for pretty much every possible strings on google, they all say the same thing. That I need to set edit/delete rights for the script towards the database.

The code should be fine, since it works on the other website perfectly. I can read from the database in the administration panel, but not edit/delete them. Don't you think it's about privileges?

What I need to know, if is it's possible to edit the rights without server admin access.

Regards,
Andreas.
  #4 (permalink)  
Old May 5th, 2010, 06:49 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well if it is its likely simply Windows security. You just need to make sure the ASP.Net user has read/write access to the file.

The quickest way to see if this is the issue it to give Everyone access to the database file - if that fixes it then you know it was permissions and can try to work out which user the ASP.Net app is trying to run as.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
Valore (May 5th, 2010)
  #5 (permalink)  
Old May 5th, 2010, 09:09 AM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Problem solved. I changed the privileges for Network Service to write for the database folder and all sub-items.

Thanks for the answers!

Regards,
Andreas.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulties with "web.config" and "ASPNETDB" CFRham BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 2 July 3rd, 2010 10:19 AM
Need code corrections "get sub or function not defined" error" bluesboytoo Excel VBA 1 October 22nd, 2009 11:12 PM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM



All times are GMT -4. The time now is 10:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.