p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Microsoft OLE DB Provider for ODBC Drivers error '80004005'


Message #1 by "Pappas Nikolaos" <pappas@c...> on Mon, 4 Dec 2000 19:31:08 +0200
Hi everybody

I am having a problem:

In my hosts Server

Trying to update a recordset I am getting errors.

It works in my PC using PWS.

It is a DSN connection and works fine in the internet browsing the recordset

but I cant add new.

The line where the error occurs is the my



Browsing with Netscape while trying to add new record

returns the following error:

------------------------------------

Microsoft OLE DB Provider for ODBC Drivers error '80004005'



[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object

is read-only.

------------------------------------

I didn't assign any user permissions to the database or password etc so

should be ok.

Please if this is related to something with the way the databases are stored

in the server please

check it out.

Thanks again

best regards

Pappas Nikos

Code Follows

-----------------------------

<%



Dim State

Dim Category

Dim Description

Dim DataConn

Dim CmdAddRecord

Dim MYSQL

Dim CookieID



Set DataConn = Server.CreateObject("ADODB.Connection")

Set CmdAddRecord = Server.CreateObject("ADODB.Recordset")



DataConn.Open "DBQ=" & Server.Mappath("../data/Sales.mdb") &

";Driver={Microsoft Access Driver (*.mdb)};"



MYSQL = "SELECT * FROM Products"



CmdAddRecord.Open MYSQL, DataConn, 1, 3



CmdAddRecord.AddNew



CmdAddRecord.Fields("State") =  State

CmdAddRecord.Fields("Category") = Category

CmdAddRecord.Fields("Description") =  Description

CmdAddRecord.Update



CmdAddRecord.Close

Set CmdAddRecord = Nothing

DataConn.Close

Set DataConn = Nothing

%>



Message #2 by TL Jackson <actionjackson@a...> on Tue, 05 Dec 2000 01:41:41 -0500
Your code might be right but the problem is problem with the database 

itself.  Go and find your database on your computer and right click on the 

icon for the database and go to properties and down at the bottom of the 

pull up menu make sure that "read only" is unchecked.  My bet is that it 

would be checked which makes it read only.



T.L.







At 07:31 PM 12/4/00 +0200, you wrote:

>Hi everybody

>I am having a problem:

>In my hosts Server

>Trying to update a recordset I am getting errors.

>It works in my PC using PWS.

>It is a DSN connection and works fine in the internet browsing the recordset

>but I cant add new.

>The line where the error occurs is the my

>

>Browsing with Netscape while trying to add new record

>returns the following error:

>------------------------------------

>Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>

>[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object

>is read-only.

>------------------------------------

>I didn't assign any user permissions to the database or password etc so

>should be ok.

>Please if this is related to something with the way the databases are stored

>in the server please

>check it out.

>Thanks again

>best regards

>Pappas Nikos

>Code Follows

>-----------------------------

><%

>

>Dim State

>Dim Category

>Dim Description

>Dim DataConn

>Dim CmdAddRecord

>Dim MYSQL

>Dim CookieID

>

>Set DataConn = Server.CreateObject("ADODB.Connection")

>Set CmdAddRecord = Server.CreateObject("ADODB.Recordset")

>

>DataConn.Open "DBQ=" & Server.Mappath("../data/Sales.mdb") &

>";Driver={Microsoft Access Driver (*.mdb)};"

>

>MYSQL = "SELECT * FROM Products"

>

>CmdAddRecord.Open MYSQL, DataConn, 1, 3

>

>CmdAddRecord.AddNew

>

>CmdAddRecord.Fields("State") =  State

>CmdAddRecord.Fields("Category") = Category

>CmdAddRecord.Fields("Description") =  Description

>CmdAddRecord.Update

>

>CmdAddRecord.Close

>Set CmdAddRecord = Nothing

>DataConn.Close

>Set DataConn = Nothing

>%>

>

>

Message #3 by "jigs gandhi" <newsgroup@h...> on Tue, 5 Dec 2000 14:34:27 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_0095_01C05EC8.78B3E6E0

Content-Type: text/plain;

	charset="windows-1253"

Content-Transfer-Encoding: quoted-printable



hi,



you have to open the "dynamic recordset set" in order to update it. 

static recordsets cannot be updated



jigs



  ----- Original Message -----

  From: Pappas Nikolaos

  To: ASP Databases

  Sent: Monday, December 04, 2000 11:01 PM

  Subject: [asp_databases] Microsoft OLE DB Provider for ODBC Drivers 

error '80004005'





  Hi everybody

  I am having a problem:

  In my hosts Server

  Trying to update a recordset I am getting errors.

  It works in my PC using PWS.

  It is a DSN connection and works fine in the internet browsing the 

recordset

  but I cant add new.

  The line where the error occurs is the my



  Browsing with Netscape while trying to add new record

  returns the following error:

  ------------------------------------

  Microsoft OLE DB Provider for ODBC Drivers error '80004005'



  [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or 

object

  is read-only.

  ------------------------------------

  I didn't assign any user permissions to the database or password etc 

so

  should be ok.

  Please if this is related to something with the way the databases are 

stored

  in the server please

  check it out.

  Thanks again

  best regards

  Pappas Nikos

  Code Follows

  -----------------------------

  <%



  Dim State

  Dim Category

  Dim Description

  Dim DataConn

  Dim CmdAddRecord

  Dim MYSQL

  Dim CookieID



  Set DataConn =3D Server.CreateObject("ADODB.Connection")

  Set CmdAddRecord =3D Server.CreateObject("ADODB.Recordset")



  DataConn.Open "DBQ=3D" & Server.Mappath("../data/Sales.mdb") &

  ";Driver=3D{Microsoft Access Driver (*.mdb)};"



  MYSQL =3D "SELECT * FROM Products"



  CmdAddRecord.Open MYSQL, DataConn, 1, 3



  CmdAddRecord.AddNew



  CmdAddRecord.Fields("State") =3D  State

  CmdAddRecord.Fields("Category") =3D Category



  CmdAddRecord.Fields("Description") =3D  Description

  CmdAddRecord.Update



  CmdAddRecord.Close

  Set CmdAddRecord =3D Nothing

  DataConn.Close

  Set DataConn =3D Nothing

  %>





  ---

  FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

  INSIGHTS IN YOUR INBOX!

  Get the latest and best C++, Visual C++, Java, Visual Basic, and XML 

tips, tools, and

  developments from the experts.  Sign up for one or more of EarthWeb?s

  FREE IT newsletters at http://www.earthweb.com today! 




$subst('Email.Unsub')










Message #4 by "Llibre, Tomas" <LlibreT@N...> on Tue, 5 Dec 2000 09:52:33 -0500
Pappas,



I am very confident your problem is related to one of two recordsert

properties: 

CursorType

http://msdn.microsoft.com/library/psdk/dasdk/mdap4j51.htm



or



CursorLocation

http://msdn.microsoft.com/library/psdk/dasdk/mdap2lgu.htm



Play with the value of these two properties.  Your problem is that the

recordset you are creating is non-updatable by default.



-----Original Message-----

From: Pappas Nikolaos [mailto:pappas@c...]

Sent: Monday, December 04, 2000 12:31 PM

To: ASP Databases

Subject: [asp_databases] Microsoft OLE DB Provider for ODBC Drivers error

'80004005'





Hi everybody

I am having a problem:

In my hosts Server

Trying to update a recordset I am getting errors.

It works in my PC using PWS.

It is a DSN connection and works fine in the internet browsing the recordset

but I cant add new.

The line where the error occurs is the my



Browsing with Netscape while trying to add new record

returns the following error:

------------------------------------

Microsoft OLE DB Provider for ODBC Drivers error '80004005'



[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object

is read-only.

------------------------------------

I didn't assign any user permissions to the database or password etc so

should be ok.

Please if this is related to something with the way the databases are stored

in the server please

check it out.

Thanks again

best regards

Pappas Nikos

Code Follows

-----------------------------

<%



Dim State

Dim Category

Dim Description

Dim DataConn

Dim CmdAddRecord

Dim MYSQL

Dim CookieID



Set DataConn = Server.CreateObject("ADODB.Connection")

Set CmdAddRecord = Server.CreateObject("ADODB.Recordset")



DataConn.Open "DBQ=" & Server.Mappath("../data/Sales.mdb") &

";Driver={Microsoft Access Driver (*.mdb)};"



MYSQL = "SELECT * FROM Products"



CmdAddRecord.Open MYSQL, DataConn, 1, 3



CmdAddRecord.AddNew



CmdAddRecord.Fields("State") =  State

CmdAddRecord.Fields("Category") = Category

CmdAddRecord.Fields("Description") =  Description

CmdAddRecord.Update



CmdAddRecord.Close

Set CmdAddRecord = Nothing

DataConn.Close

Set DataConn = Nothing

%>

Message #5 by "Li, Fang" <fang@c...> on Tue, 5 Dec 2000 10:48:59 -0500
I have access database file in my web server, if I change this file's

attributes to : Read only.  I got the same error code:

'80004005'

make sure your file is not readonly. 





-----Original Message-----

From: Pappas Nikolaos [mailto:pappas@c...]

Sent: Monday, December 04, 2000 12:31 PM

To: ASP Databases

Subject: [asp_databases] Microsoft OLE DB Provider for ODBC Drivers error

'80004005'





Hi everybody

I am having a problem:

In my hosts Server

Trying to update a recordset I am getting errors.

It works in my PC using PWS.

It is a DSN connection and works fine in the internet browsing the recordset

but I cant add new.

The line where the error occurs is the my



Browsing with Netscape while trying to add new record

returns the following error:

------------------------------------

Microsoft OLE DB Provider for ODBC Drivers error '80004005'



[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object

is read-only.

------------------------------------

I didn't assign any user permissions to the database or password etc so

should be ok.

Please if this is related to something with the way the databases are stored

in the server please

check it out.

Thanks again

best regards

Pappas Nikos

Message #6 by "Ken Schaefer" <ken@a...> on Wed, 6 Dec 2000 12:10:22 +1100
The JET provider automatically returns a keyset cursor if you choose any

locktype other than adLockReadOnly. Attempting to open an adOpenStatic

cursor with a locktype such as adLockOptimistic will return an adOpenKeyset

cursor. Also, you can't return an adOpenDynamic cursor - the JET provider

does not support this.



Make sure that the locktype isn't adLockReadOnly, and then check the

permissions on the file. The IUSR_<machinename> account needs permissions to

write to the file.



Cheers

Ken



----- Original Message -----

From: "jigs gandhi" <newsgroup@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, December 05, 2000 8:04 PM

Subject: [asp_databases] Re: Microsoft OLE DB Provider for ODBC Drivers

error '80004005'





hi,



you have to open the "dynamic recordset set" in order to update it. static

recordsets cannot be updated



jigs



  ----- Original Message -----

  From: Pappas Nikolaos

  To: ASP Databases

  Sent: Monday, December 04, 2000 11:01 PM

  Subject: [asp_databases] Microsoft OLE DB Provider for ODBC Drivers error

'80004005'





  Hi everybody

  I am having a problem:

  In my hosts Server

  Trying to update a recordset I am getting errors.

  It works in my PC using PWS.

  It is a DSN connection and works fine in the internet browsing the

recordset

  but I cant add new.

  The line where the error occurs is the my



  Browsing with Netscape while trying to add new record

  returns the following error:

  ------------------------------------

  Microsoft OLE DB Provider for ODBC Drivers error '80004005'



  [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or

object

  is read-only.

  ------------------------------------

  I didn't assign any user permissions to the database or password etc so

  should be ok.

  Please if this is related to something with the way the databases are

stored

  in the server please

  check it out.

  Thanks again

  best regards

  Pappas Nikos

  Code Follows

  -----------------------------

  <%



  Dim State

  Dim Category

  Dim Description

  Dim DataConn

  Dim CmdAddRecord

  Dim MYSQL

  Dim CookieID



  Set DataConn = Server.CreateObject("ADODB.Connection")

  Set CmdAddRecord = Server.CreateObject("ADODB.Recordset")



  DataConn.Open "DBQ=" & Server.Mappath("../data/Sales.mdb") &

  ";Driver={Microsoft Access Driver (*.mdb)};"



  MYSQL = "SELECT * FROM Products"



  CmdAddRecord.Open MYSQL, DataConn, 1, 3



  CmdAddRecord.AddNew



  CmdAddRecord.Fields("State") =  State

  CmdAddRecord.Fields("Category") = Category



  CmdAddRecord.Fields("Description") =  Description

  CmdAddRecord.Update



  CmdAddRecord.Close

  Set CmdAddRecord = Nothing

  DataConn.Close

  Set DataConn = Nothing

  %>





  

  Return to Index