Read/Write problems with DAO and DBase file 
Author Message
 Read/Write problems with DAO and DBase file

Howdy.

When opening some DBase files using DAO, I can read and .AddNew records,
but I cannot .Edit or .Delete existing records in the .DBF files.
Anybody know anything about this?

Details:

db is opened as follows:

  Set dbTarget = OpenDatabase(sDBPath, 0, 0, "dBASE III;")

table is opened:

  Set rsTarget = dbTarget.OpenRecordset(sTblTarget, dbOpenTable, 0,
dbOptimistic)

The following:

  rsTarget.Edit
  rsTarget!fieldname = value
  rsTarget.Update

results in an error 3251 - "Operation is not supported for this type of
object."

While:

  rsTarget.AddNew
  rsTarget!fieldname = value
  rsTarget.Update

works perfectly.

Any insight is greatly appreciated.

Chris Judge,
FormFill, Inc.



Sat, 06 Sep 2003 01:59:59 GMT  
 Read/Write problems with DAO and DBase file
Hello Chris

Try
  rsTarget.Edit
  rsTarget!fieldname = value
  rsTarget.Update
  rsTarget.MoveNext 'Remark if you reach EOF, then an Error Handler will
have to be coded

Sukesh


Quote:
> Howdy.

> When opening some DBase files using DAO, I can read and .AddNew records,
> but I cannot .Edit or .Delete existing records in the .DBF files.
> Anybody know anything about this?

> Details:

> db is opened as follows:

>   Set dbTarget = OpenDatabase(sDBPath, 0, 0, "dBASE III;")

> table is opened:

>   Set rsTarget = dbTarget.OpenRecordset(sTblTarget, dbOpenTable, 0,
> dbOptimistic)

> The following:

>   rsTarget.Edit
>   rsTarget!fieldname = value
>   rsTarget.Update

> results in an error 3251 - "Operation is not supported for this type of
> object."

> While:

>   rsTarget.AddNew
>   rsTarget!fieldname = value
>   rsTarget.Update

> works perfectly.

> Any insight is greatly appreciated.

> Chris Judge,
> FormFill, Inc.



Mon, 08 Sep 2003 14:31:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DBASE III- having problems reading dBASE files to VB

2. How to read/write dBase dbf/ndx files?

3. Problem with DAO CreateTabelDef connecting a DBase 5.0 file

4. Reading & Writing Hex files problem

5. Problem reading/writing/deleting file

6. Problem reading and writing to files using VBScript

7. Read/Write INI on Program File Vista Problem

8. Problem: Reading and writing binary files with VB6!

9. Writing a VBS file which reads and writes to the registry

10. DAO, copy data to dBase file.

11. Using dbase MDX Files in VB Apps w/DAO

12. Connect dBase Files With DAO

 

 
Powered by phpBB® Forum Software