If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Access Database permission problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-04, 21:22
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Question Access Database permission problem

I am using the following code snippet to delete a record from an Access database:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("personal.mdb"))

sql="DELETE * FROM plant_list"
sql=sql & " WHERE plant_id=" & request.QueryString("entry")
response.Write(sql)
response.write("<br />")
on error resume next
conn.Execute sql
if err<>0 then
response.write err.description
else
response.write("Record " & request.QueryString("entry") & " was deleted!")
end if
conn.close
%>

I did NOT set any password on the database through Access.

I get the following error:

"Could not delete from specified tables."

I did a response.write (sql) to make sure the query was properly formatted. It returned:

"DELETE * FROM plant_list WHERE plant_id=18"

The database exists, the table exists, the field exists, as does record id 18.

The database has all permissions on the server.

What am I doing wrong?

Any help is appreciated! Thanks.
Reply With Quote
  #2 (permalink)  
Old 02-15-04, 03:18
Patrick Chua Patrick Chua is offline
Registered User
 
Join Date: Jul 2003
Location: Penang, Malaysia
Posts: 212
Try setting "write" permission to the folder from ISS server where your MDB file is.

Is it already set to "write" permission?
__________________
Patrick Chua
LBMS ( Learn By My Self) NPQ ( No paper Qualification )
Reply With Quote
  #3 (permalink)  
Old 02-15-04, 15:33
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Yes, I double checked. It was already set 777 or read, write, execute.

I also tried moving the database into different directories. Each time it produced the same error:

"Could not delete from specified tables."

Is it something I need to set in the access database itself?

Any ideas?

Thanks.
Reply With Quote
  #4 (permalink)  
Old 02-16-04, 08:15
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
And the field IS a number field instead of a text field right (since no single quotes)?
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #5 (permalink)  
Old 02-16-04, 11:33
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Yes, it is an "AutoNumber" field.

Thanks for your response.

Any other ideas?

This is driving me nuts! (slowly)
Reply With Quote
  #6 (permalink)  
Old 02-18-04, 19:57
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Anyone with an idea? Thanks.
Reply With Quote
  #7 (permalink)  
Old 02-18-04, 20:02
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
You don't have any foriegn key constraints on that table do you??

Have you tried runnign the query from within access to see if it gives you more details about the error??

Last edited by rokslide; 02-18-04 at 20:06.
Reply With Quote
  #8 (permalink)  
Old 02-18-04, 22:05
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Sombody told me that maybe I shouldn't have the * in the query. I have tried it both ways, and still get the error.

Yes, I ran the query from within Access on my local machine and it deletes the record without problem.
Reply With Quote
  #9 (permalink)  
Old 02-18-04, 22:46
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
What is your local machine and how does it differ from your server??
Reply With Quote
  #10 (permalink)  
Old 02-18-04, 23:19
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
local machine = home where I am doing the programming
server = web server where my website resides

Hope that clarifies it.
Reply With Quote
  #11 (permalink)  
Old 02-18-04, 23:32
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
OS's?? Web Server Software? etc
Reply With Quote
Reply

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On