Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: HELP!! Cannot update. Database or object is read-only


Message #1 by valentino@t... on Mon, 14 May 2001 15:29:02
Hi, I'm against a wall!!



I use the following code:



        Dim strDataNews, strTitleNews, strTestoNews

	Dim objRS

	

	strDataNews = Request.Form("Data_News")

	strTitleNews = Request.Form("Title_News")

	strTestoNews = Request.Form("Testo_News")

	

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

	objRS.Open "News", strConnect, adOpenStatic, 

                    adLockOptimistic,adCmdTable

	

	objRS.MoveLast

	objRS.AddNew

	objRS("DataNews") = strDataNews

	objRS("TitoloNews") = strTitleNews

	objRS("FullNews") = strTestoNews

	objRS.Update

	objRS.Close

	

	Set objRS = Nothing



which is almost the same as the one showed at page 595-6. I try to 

populate a Database but I get the error showed in the Subject line at the 

line containing "objRS.AddNew". 



The first field in the DB is a "AutoNumber" field called "NewsID" which is 

supposed to update itself.



What is wrong in this code and why do I get this error?



This is the full error:



Error Type:

Microsoft JET Database Engine (0x80040E09)

Cannot update. Database or object is read-only.



Thanks for help.





Message #2 by "Pappas Nikos" <pappas@c...> on Mon, 14 May 2001 20:09:03 +0300
	objRS.Open "News", strConnect, adOpenStatic,

                    adLockOptimistic,adCmdTable

THIS IS WRONG

what is "news"?

there's an SQL expression missing here

to describe what records should be returned.

Post some code with your strConnect



I have found some connection examples here.

http://www.able-consulting.com/ado_conn.htm#ODBCDriverForAccess



Kens site is cool for info and errors too

http://www.adopenstatic.com/faq/



Very important

Check permissions for the folder and database in your server.

Is there any write permissions set?



all the best

Nikos





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

From: valentino@t... [mailto:valentino@t...]

Sent: Monday, May 14, 2001 6:34 PM

To: ASP Database Setup

Subject: [asp_database_setup] HELP!! Cannot update. Database or object

is read-only





Hi, I'm against a wall!!



I use the following code:



        Dim strDataNews, strTitleNews, strTestoNews

	Dim objRS



	strDataNews = Request.Form("Data_News")

	strTitleNews = Request.Form("Title_News")

	strTestoNews = Request.Form("Testo_News")



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

	objRS.Open "News", strConnect, adOpenStatic,

                    adLockOptimistic,adCmdTable



	objRS.MoveLast

	objRS.AddNew

	objRS("DataNews") = strDataNews

	objRS("TitoloNews") = strTitleNews

	objRS("FullNews") = strTestoNews

	objRS.Update

	objRS.Close



	Set objRS = Nothing



which is almost the same as the one showed at page 595-6. I try to

populate a Database but I get the error showed in the Subject line at the

line containing "objRS.AddNew".



The first field in the DB is a "AutoNumber" field called "NewsID" which is

supposed to update itself.



What is wrong in this code and why do I get this error?



This is the full error:



Error Type:

Microsoft JET Database Engine (0x80040E09)

Cannot update. Database or object is read-only.



Thanks for help.

Message #3 by valentino@t... on Tue, 15 May 2001 08:49:02
Hi,



"News" was the Table name where I want to add a record. I changed it now 

to "Novita".



I gave Write permission to the Server but it still shows me the same error.

Would you mind having a look at my application? I zipped it and could send 

you it with a explanation which pages to open. It would be very kind of 

you! I just need you mail address.



Many thanks in adavance.



Valentino

valentino@t...









> 	objRS.Open "News", strConnect, adOpenStatic,

>                     adLockOptimistic,adCmdTable

> THIS IS WRONG

> what is "news"?

> there's an SQL expression missing here

> to describe what records should be returned.

> Post some code with your strConnect

> 

> I have found some connection examples here.

> http://www.able-consulting.com/ado_conn.htm#ODBCDriverForAccess

> 

> Kens site is cool for info and errors too

> http://www.adopenstatic.com/faq/

> 

> Very important

> Check permissions for the folder and database in your server.

> Is there any write permissions set?

> 

> all the best

> Nikos

> 

> 

> -----Original Message-----

> From: valentino@t... [mailto:valentino@t...]

> Sent: Monday, May 14, 2001 6:34 PM

> To: ASP Database Setup

> Subject: [asp_database_setup] HELP!! Cannot update. Database or object

> is read-only

> 

> 

> Hi, I'm against a wall!!

> 

> I use the following code:

> 

>         Dim strDataNews, strTitleNews, strTestoNews

> 	Dim objRS

> 

> 	strDataNews = Request.Form("Data_News")

> 	strTitleNews = Request.Form("Title_News")

> 	strTestoNews = Request.Form("Testo_News")

> 

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

> 	objRS.Open "News", strConnect, adOpenStatic,

>                     adLockOptimistic,adCmdTable

> 

> 	objRS.MoveLast

> 	objRS.AddNew

> 	objRS("DataNews") = strDataNews

> 	objRS("TitoloNews") = strTitleNews

> 	objRS("FullNews") = strTestoNews

> 	objRS.Update

> 	objRS.Close

> 

> 	Set objRS = Nothing

> 

> which is almost the same as the one showed at page 595-6. I try to

> populate a Database but I get the error showed in the Subject line at the

> line containing "objRS.AddNew".

> 

> The first field in the DB is a "AutoNumber" field called "NewsID" which 

is

> supposed to update itself.

> 

> What is wrong in this code and why do I get this error?

> 

> This is the full error:

> 

> Error Type:

> Microsoft JET Database Engine (0x80040E09)

> Cannot update. Database or object is read-only.

> 

> Thanks for help.


  Return to Index