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 > Problems connecting to an Access DB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 16:45
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Problems connecting to an Access DB

I am using the following code snippet to connect to an Access db. What am I doing wrong?

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("personal.mdb;UID=;PWD=12 34"))

It responds with the error:

"Microsoft JET Database Engine error '80004005'

Could not find installable ISAM."


I set the password thru Access; it did not mention any user ID.

Any help is appreciated. Thanks.
Reply With Quote
  #2 (permalink)  
Old 02-11-04, 18:56
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Try this:

Set conn=Server.CreateObject("ADODB.Connection")
connString = "Microsoft.Jet.OLEDB.4.0; Data Source=FilePath; UID=userID;PWD=password"
conn.ConnectionString = connString
conn.Open
Reply With Quote
  #3 (permalink)  
Old 02-11-04, 22:16
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
That didn't appear to help.

Let me expound further.

I am able to connect to the Access db using these lines:

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

I can read data from the tables, but when i try and delete a row using the following code snippet i get and error:

"No update permissions!"

This is the code:

[i]<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("costa.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
rs.open "SELECT * FROM plant_list", conn
sql="DELETE FROM plant_list"
sql=sql & " WHERE plant_id='" & request.QueryString("entry") & "'"
on error resume next
conn.Execute sql
if err<>0 then
response.write("No update permissions!")
else
response.write("Record " & request.QueryString("entry") & " was deleted!")
end if
conn.close
%>[i]

I assumed that maybe the file permissions were not set on the server. But upon firther examination, they are set "777". So I thought it might be a db error.

Please help. Thanks.
Reply With Quote
  #4 (permalink)  
Old 02-11-04, 22:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
instead of

response.write("No update permissions!")

why don't you

response.write err.description

??
Reply With Quote
  #5 (permalink)  
Old 02-11-04, 23:30
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
Ok I did that. It may have narrowed down the problem

Now I get this error:

"Could not delete from specified tables."

My query string is this:

DELETE FROM plant_list WHERE plant_id=18

I verified that the table "plant_list" does exist and that the field name "plant_id" also exists, and that a field does contain the number 18.

Where have I erred?
Reply With Quote
  #6 (permalink)  
Old 02-12-04, 00:11
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
In the Web site's control panel give the folder containing the database more permissions than just read.
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #7 (permalink)  
Old 02-12-04, 00:22
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
I checked that first actually... the file has 7's across the board. But thanks.
Reply With Quote
  #8 (permalink)  
Old 02-12-04, 00:49
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
what happens if you try and run that delete query in the access db??
Reply With Quote
  #9 (permalink)  
Old 02-12-04, 01:50
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
On my local machine when I run the following query,

DELETE FROM plant_list WHERE plant_id=18

It deletes the one run, no problem.
Reply With Quote
  #10 (permalink)  
Old 02-12-04, 02:25
Patrick Chua Patrick Chua is offline
Registered User
 
Join Date: Jul 2003
Location: Penang, Malaysia
Posts: 212
I am having a similar problem....


this is my error message:

"No update permissions!-2147467259"


I did it in my local pc...everything is okay...ftp the files to the host server....damn!


What I need to do??
__________________
Patrick Chua
LBMS ( Learn By My Self) NPQ ( No paper Qualification )
Reply With Quote
  #11 (permalink)  
Old 02-12-04, 11:19
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
I think that this is the database permission problem. Since you do not have UID I suggest you to create Login which is used for your ASP connection. At that point, you can give READ and WRITE permission to it.
Reply With Quote
  #12 (permalink)  
Old 02-12-04, 14:27
mturner mturner is offline
Registered User
 
Join Date: Feb 2004
Posts: 41
I removed the password through Access.

I still get the,

"Could not delete from specified tables."

error.

I can run the query without problem through access on my local machine.

How do I create Login which is used for my ASP connection?

Any help is appreciate, thanks.
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