Cannot add record to Visual Foxpro table after deleting all records in table 
Author Message
 Cannot add record to Visual Foxpro table after deleting all records in table

After:
1. opening adodb connection with
vfpoledb.dll and datasource=path$ &
foxprofile.dbc successfully
2. deleting all records from table1 in
foxprofile.dbc successfully with
connection.execute("delete from table1") (I
can see the records being marked as deleted
in the VFP IDE) ,

I cannot add any record to table1 that has a
primary key like one of the deleted records.
So I execute connection.execute("pack
table1") and get "ADO error: File is in use".
(but my foxpro IDE is closed and only my VB6
program has the *.dbc open).

How can I delete (and pack if necessary) all
the records so they are gone for good from
the table?

Please!
Thank you.



Tue, 18 Jan 2005 08:14:33 GMT
 Cannot add record to Visual Foxpro table after deleting all records in table

Peter

Possible solution is to delete records, disconnect the recordset (or close
and re-open the connection) and then issue database commands -
Pack etc.

Sukesh


Quote:
> After:
> 1. opening adodb connection with
> vfpoledb.dll and datasource=path$ &
> foxprofile.dbc successfully
> 2. deleting all records from table1 in
> foxprofile.dbc successfully with
> connection.execute("delete from table1") (I
> can see the records being marked as deleted
> in the VFP IDE) ,

> I cannot add any record to table1 that has a
> primary key like one of the deleted records.
> So I execute connection.execute("pack
> table1") and get "ADO error: File is in use".
> (but my foxpro IDE is closed and only my VB6
> program has the *.dbc open).

> How can I delete (and pack if necessary) all
> the records so they are gone for good from
> the table?

> Please!
> Thank you.



Tue, 18 Jan 2005 11:24:47 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. deleting records in a table and then adding new records

2. add records to access table fails with back cannot update read-only database

3. cannot delete record from external table (.dbf file)..

4. Records cannot be deleted in forms or tables

5. Records cannot be deleted in forms or tables.

6. ADO2.5, can't add new record to an empty table using record binding

7. Adding a new record to a table after a delete

8. SQL7 server crawls (locks) when deleting records from a 3 million record table

9. add record to an empty table using RDO 2.0 and Visual basic 6.0

10. Adding a new record in Foxpro table using ADO

11. Deleting Records In One Table Based on records in Another

12. How to add a new record to an empty table using RDO and visual basic 6.0


 
Powered by phpBB® Forum Software