473,569 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting rows in Access database table

I get an error message when deleting rows from a table in Access database.

My understanding is that the error message relates to the sharing of the
Inetpub and the wwwroot directory.

While I have set the directories to "Share" in the properties window, it
still does not allow row removal.

I'm running Microsoft Windows XP, Professional, Version 2002, Service Pack 1.

The code is as follows and the error message is after it.
*************** ** Start Code *************** *****
<%@ import Namespace="Syst em.Data" %>
<%@ import Namespace="Syst em.Data.Oledb" %>

Sub Page_Load(Sende r as object, e as EventArgs)
if not isPostBack then

Dim Con As OleDbConnection = New OleDbConnection
Dim DA As OleDbDataAdapte r = New OleDbDataAdapte r
Dim ConnectString, delCmd, x as String

x = Server.Mappath( "\ASPClass\Fina lProj\DB.mdb")

ConnectString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & x

Con.ConnectionS tring = ConnectString
delCmd = "DELETE * FROM ORDERS"

DA.DeleteComman d = New OleDbCommand(de lCmd, Con)
Con.Open
DA.DeleteComman d.ExecuteNonQue ry()

end if
End Sub
*************** ***** End Code *************** *****

*************** ***** Start 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.Ole Db.OleDbExcepti on: Could not delete from
specified tables.

Source Error:

Line 29: DA.DeleteComman d = New OleDbCommand(de lCmd, Con)
Line 30: Con.Open
Line 31: DA.DeleteComman d.ExecuteNonQue ry()
Line 32: '************** *************** *******
Line 33: end if
Source File: c:\inetpub\wwwr oot\ASPClass\Fi nalProj\ShopSig nIn.aspx Line:
31

Stack Trace:
[OleDbException (0x80004005): Could not delete from specified tables.]
System.Data.Ole Db.OleDbCommand .ExecuteCommand TextErrorHandli ng(Int32 hr)
+41

System.Data.Ole Db.OleDbCommand .ExecuteCommand TextForSingleRe sult(tagDBPARAM S
dbParams, Object& executeResult) +154
System.Data.Ole Db.OleDbCommand .ExecuteCommand Text(Object& executeResult)
+92
System.Data.Ole Db.OleDbCommand .ExecuteCommand (CommandBehavio r behavior,
Object& executeResult) +65
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method) +112
System.Data.Ole Db.OleDbCommand .ExecuteNonQuer y() +54
ASP.ShopSignIn_ aspx.Page_Load( Object Sender, EventArgs e) in
c:\inetpub\wwwr oot\ASPClass\Fi nalProj\ShopSig nIn.aspx:31
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +29
System.Web.UI.P age.ProcessRequ estMain() +742
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.370 5.6018; ASP.NET
Version:1.0.370 5.6018

*************** ***** End Error Message *************** ******
Thank you for your help.

Mark

Nov 22 '05 #1
6 3644
> DELETE * FROM ORDERS

I believe this is incorrect.

Try "DELETE FROM ORDERS"

--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"Mark" <Ma**@discussio ns.microsoft.co m> wrote in message news:69******** *************** ***********@mic rosoft.com...
I get an error message when deleting rows from a table in Access database.

My understanding is that the error message relates to the sharing of the
Inetpub and the wwwroot directory.

While I have set the directories to "Share" in the properties window, it
still does not allow row removal.

I'm running Microsoft Windows XP, Professional, Version 2002, Service Pack 1.

The code is as follows and the error message is after it.
*************** ** Start Code *************** *****
<%@ import Namespace="Syst em.Data" %>
<%@ import Namespace="Syst em.Data.Oledb" %>

Sub Page_Load(Sende r as object, e as EventArgs)
if not isPostBack then

Dim Con As OleDbConnection = New OleDbConnection
Dim DA As OleDbDataAdapte r = New OleDbDataAdapte r
Dim ConnectString, delCmd, x as String

x = Server.Mappath( "\ASPClass\Fina lProj\DB.mdb")

ConnectString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & x

Con.ConnectionS tring = ConnectString
delCmd = "DELETE * FROM ORDERS"

DA.DeleteComman d = New OleDbCommand(de lCmd, Con)
Con.Open
DA.DeleteComman d.ExecuteNonQue ry()

end if
End Sub
*************** ***** End Code *************** *****

*************** ***** Start 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.Ole Db.OleDbExcepti on: Could not delete from
specified tables.

Source Error:

Line 29: DA.DeleteComman d = New OleDbCommand(de lCmd, Con)
Line 30: Con.Open
Line 31: DA.DeleteComman d.ExecuteNonQue ry()
Line 32: '************** *************** *******
Line 33: end if
Source File: c:\inetpub\wwwr oot\ASPClass\Fi nalProj\ShopSig nIn.aspx Line:
31

Stack Trace:
[OleDbException (0x80004005): Could not delete from specified tables.]
System.Data.Ole Db.OleDbCommand .ExecuteCommand TextErrorHandli ng(Int32 hr)
+41

System.Data.Ole Db.OleDbCommand .ExecuteCommand TextForSingleRe sult(tagDBPARAM S
dbParams, Object& executeResult) +154
System.Data.Ole Db.OleDbCommand .ExecuteCommand Text(Object& executeResult)
+92
System.Data.Ole Db.OleDbCommand .ExecuteCommand (CommandBehavio r behavior,
Object& executeResult) +65
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method) +112
System.Data.Ole Db.OleDbCommand .ExecuteNonQuer y() +54
ASP.ShopSignIn_ aspx.Page_Load( Object Sender, EventArgs e) in
c:\inetpub\wwwr oot\ASPClass\Fi nalProj\ShopSig nIn.aspx:31
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +29
System.Web.UI.P age.ProcessRequ estMain() +742
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.370 5.6018; ASP.NET
Version:1.0.370 5.6018

*************** ***** End Error Message *************** ******
Thank you for your help.

Mark

Nov 22 '05 #2
Mark,

Have a look at this page, I don't think you want to use the statement as you
wrote it.

http://msdn.microsoft.com/library/de.../acfundsql.asp

I hope this helps,

Cor
Nov 22 '05 #3
Thanks for your comments.

I changed the SQL to "DELETE FROM ORDERS" but still get the same error.

I have been led to believe that the problem is not with the SQL, but is file
sharing related.

All of the directories within the directory path of the Access database have
been set to "Share the folder" with the permissions set to "Full Control" via
the directory's Properties Window. But to no avail. (The Database resides
in the c:\Inetpub\wwwr oot\ASPClass\Fi nalProj directory.)

I'm running Microsoft Windows XP, Professional, Version 2002, Service Pack 1.

Is there aonther newsgroup which is focused on file sharing issues?

Thanks,

Mark


Nov 22 '05 #4
Mark,

What do you want to delete?

Cor
Nov 22 '05 #5
Sharing has nothing to do with web apps -- just networking. You want
to right-click on either the folder containing the DB or the DB file
itself and choose "Properties ". On the security tab, you want to give
read/write permissions to either "Everyone" (not recommended for
production environments but OK for local projects) or the asp.net
account, usuall called "Launch IIS Process Account
(machinename\IW AM_machinename) .

Cheers,
Chid

Nov 22 '05 #6
On Thu, 21 Apr 2005 19:04:03 -0700, "Mark" <Ma**@discussio ns.microsoft.co m> wrote:

¤ I get an error message when deleting rows from a table in Access database.
¤
¤ My understanding is that the error message relates to the sharing of the
¤ Inetpub and the wwwroot directory.
¤
¤ While I have set the directories to "Share" in the properties window, it
¤ still does not allow row removal.
¤
¤ I'm running Microsoft Windows XP, Professional, Version 2002, Service Pack 1.
¤
¤ The code is as follows and the error message is after it.

See the following MS KB article:

http://support.microsoft.com/default...b;en-us;316675
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 22 '05 #7

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

Similar topics

6
506
by: Mark | last post by:
I get an error message when deleting rows from a table in Access database. My understanding is that the error message relates to the sharing of the Inetpub and the wwwroot directory. While I have set the directories to "Share" in the properties window, it still does not allow row removal. I'm running Microsoft Windows XP, Professional,...
13
7762
by: Dixie | last post by:
How do I, in VBA from an access form module, add 5 rows to the top of a spreadsheet called MySpreadsheet.xls. The worksheet is called MyWorksheet and there is already data in the first 5 rows. I simply need to insert 5 blank rows at the top and move the rest of the data down so it starts at row 6. dixie
2
2178
by: Zak McGregor | last post by:
Hi all I have a table, for simplicity's sake containing one field, called unid. for example, select unid, oid from table gives me something like this: unid | oid ---------+---------
9
1711
by: Hamed | last post by:
Hello I have a DataGrid that a is bound to a DataTable. Some of the rows in the DataTable should not be deleted. How can I prohibit deleting of some identified rows? The problem could be specified in the following format too: There is a DataView object that I want to prohibit deleting of some of its DataRowView objects. that is: when...
1
8765
by: vadarv | last post by:
Hia! I'm a total amateur to VBS but need help on a VBS script. This is used in a HMI system from Siemens called WinCC, used for process viewing and control. What I need to is to write to a table in Access, then read these values and then delete records (rows) in Access. By using help functions in WinCC I have this set up: I created an...
7
6591
by: Susan Mackay | last post by:
I have a data table that is connected to a database table with a data adapter in the 'standard' manner. However I want to be able to remove selected rows from the data table (i.e. no longer include them in the set that is displayed to the user) but I don't want to delete the corresponding row from the database. I've tried using the...
24
21551
by: Frank Swarbrick | last post by:
We have a batch process that inserts large numbers (100,000 - 1,000,000) of records into a database each day. (DL/I database.) We're considering converting it to a DB2 table. Currently we have logic in place that, prior to inserting any data, reads the first input record and checks to see if it already exists in the table. If the record...
1
2840
by: dmcadams | last post by:
I need help deleting 300 Millions of rows from a table and then reclaim the space in the table after completing the delete process. The database needs to be online and available to the users. There is one bitmapped index on the field which is the criteria field used for selecting which records to delete. That field is TIME_ID There is one...
5
2039
flexsingh
by: flexsingh | last post by:
Hello there, I have been trying to delete a row in php for a long time now and its getting frustrating, can any see if they could possible help me please. My first page is <?php // this starts the session session_start(); ?>
4
2384
by: sphinney | last post by:
I'm not exactly sure how to start this post. My question is pretty simple, but it will take a little bit of context before I can state it. (And thanks in advance for taking the time to read this!) Context: What I'm essentially trying to do is create a poor man's document imaging system in Access 2007. I have a database that contains forms and...
0
7701
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
7615
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
7924
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. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
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
5514
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
5219
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
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.