Forum Moderators: open

Message Too Old, No Replies

Add New Record Error

         

asifit

9:47 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



I am using Windows XP Professional.
I have problem with insert/Updat a record to MS-Access database.

Error Type:
Microsoft JET Database Engin (0x80040E09)
Cannot update. Database or object is read-only.

My Code:

Dim DataConn, CmdAddRec, SQL
DataConn = Server.createObject("ADODB.Connection")
Set CmdAddRec = Server.CreateObject("ADODB.RecordSet")
DataConn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("HTLM.mdb")
SQL = "Select * from TBLGuest"
CmdAddRec.Open SQL,DataConn,1,3
CmdAddRec.Addnew
CmdAddRec.Fields("FName") = "Asif"
CmdAddRec.Fields("LName") = "Ikhlas"
CmdAddRec.Update
CmdAddRec.Close
Set CmdAddRec = Nothing
DataConn.Close
Set DataConn = Nothing

Can any one please help me ASAP?
Regards,

tomasz

10:05 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



change permissions of your database to write

asifit

11:03 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



recordset has already got read and write permission.
Or
Can you please let me know how to do it?

Thanks alot

defanjos

11:26 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This could be your problem [webmasterworld.com]

wackal

11:29 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



the problem is not with your code, the security permissions of the .mdb file need to be changed. You need to right click the database file and make sure everyone has write permissions on db

asifit

12:01 am on Feb 11, 2004 (gmt 0)

10+ Year Member



Well, I am using MS-Office XP
I have log in as administrator and I should have full access to the database by default.

I have also right clicked on the database then properties every thing looks normal.

Or Please state it step by step

Thanks

asifit

8:25 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



Thank you very much to all of you.
It is working I test it on another computer and change the permission to write.

Regards,