PDA

Click to See Complete Forum and Search --> : Help again!! Update query problem


gerard
Aug 2nd, 2000, 08:10 AM
In big trouble here!!

I'm dealing with dBase V files...I can get a ADO connection no problem I can run basic select queries over them. BUT if I try an update or insert query over them I get the following error!!

- Operation must use an updatable query. -

Any ideas how I can get around this and run my action queries...!

Regards


Gerard

Gary.Lowe
Aug 2nd, 2000, 09:26 AM
gerard

SOunds like your connection could be read only or something similar.

Can you post the connection code

gerard
Aug 2nd, 2000, 09:39 AM
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = New ADODB.Connection

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\data\dbffiles\;Extended Properties=Dbase IV"

Set rs = cn.Execute("UPDATE NAMETBL SET NAMETBL.GIVENAME = 'Peter'")

cn.Close
Set cn = Nothing

Gary.Lowe
Aug 2nd, 2000, 10:01 AM
gerard

have you tried just running the query i.e


cn.Execute("UPDATE NAMETBL SET NAMETBL.GIVENAME = 'Peter'")

'instead of
Set rs = cn.Execute("UPDATE NAMETBL SET NAMETBL.GIVENAME = 'Peter'")



If you try that and it works you may have to set some properties of the recordset first.

gerard
Aug 2nd, 2000, 10:10 AM
Tried your suggest get same error..not sure what rs properties I may need to set..

Gary.Lowe
Aug 2nd, 2000, 10:23 AM
Sorry gerard

I can't think of anything that would cause the error.

It sounds like the connection is read only which would explain why the select query works.

I am not sure what properties you would have to set to make make sure the connection is read/write.

I remember somone else having a similar problem a while back but I'm not sure if it was resolved.


Come on guy's, li'l help

gerard
Aug 2nd, 2000, 10:26 AM
Thanks anyway!