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 > PC based Database Applications > Other PC Databases > ERROR: Attempt to write a readonly database (8).

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-10, 12:15
sabu28 sabu28 is offline
Registered User
 
Join Date: Aug 2007
Posts: 6
ERROR: Attempt to write a readonly database (8).

Hi,

I am trying to update an SQLite 3 database in ASP (code attached) having made the connection using the ODBC driver sqlite3odbc.dll. It gives the following error:

Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
attempt to write a readonly database (8)


However, I am able to issue the SELECT query in the ASP code which works fine. Also, the database allows SELECT/INSERT/UPDATE/DELETE from the command prompt using the interactive sqlite3.exe without any problems.

How can I open the database for read/write so that I am able to insert/update/delete rows in the SQLite 3 database. An early reply would be highly appreciated.

Regards

Sabu.

Code:
<&#37;

Dim conn, rs, strSQL

set conn=Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
conn.connectionstring="Driver=SQLite3 ODBC Driver;Database=H:\skmweb\r15\skmtest1.db;"
conn.Mode=3
conn.open

strSQL = "select a.fld1, b.fld2 from tbl1 a, tbl2 b "
strSQL = strSQL & "where b.fld1 = a.fld1 "
rs.open strSQL, conn

Do While Not rs.EOF
	Response.Write "Record Value: " & rs("fld1") & " ---- " & rs("fld2") & "<br>"
	rs.MoveNext
Loop
rs.Close

strSQL="update tbl2 set fld2 = 'Kolkata' where fld1 = 25 "
conn.Execute strSQL
strSQL="update tbl2 set fld2 = 'Bangalore' where fld1 = 12 "
conn.Execute strSQL

set rs = Nothing
conn.Close
set conn = Nothing

%>
Reply With Quote
Reply

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