Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL err db is read only 1

Status
Not open for further replies.

ClulessChris

IS-IT--Management
Jan 27, 2003
890
GB
I have a routine that uses an SQL statment to save a record, somthing like:

set db = "file Path"

set rst1 = db.Openrecordset _
("SELECT tblone.*, tbltwo.*, tblthree.* FROM tblone, tbltwo, tblthree WHERE tblone.field1 = " & lblone & " AND tbltwo.field2 = " & lbltwo & " AND tblthree.field3 = " & lblthree, dbOpenDynaset)

With rst

.Edit

It's at this point I get an err "database is read only". The back end is fine and if I break the SQL down to a more simple statment i get no err.

Can anyone help me work around this?
Thanks in advance for any help.
 
The MSDN Library VB Docs say:

A dynaset-type Recordset object may not be updatable if:

(1) There isn't a unique index on the ODBC or Paradox table or tables.


(2) The data page is locked by another user.


(3) The record has changed since you last read it.


(4) The user doesn't have permission.


(5) One or more of the tables or fields are read-only.


(6) The database is opened as read-only.


(7) The Recordset object was either created from multiple tables without a JOIN statement or the query was too complex.

I think number 7 may apply in your situation.

Hope this helps. Good luck. I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
JeBenson
Thanks for a prompt reply most helpful could you give an example of a JOIN stament (I'm kind of new to this).
 
I can't really write a JOIN statement for you without knowing more about the relationship between the tables you are joining. You can check out this quick intro to the JOIN statement:


There are also many other resources both on the web and in print that can help you with this.

Good luck! I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top