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. need something like foreach record in table - add record to another table

3. delete a record in FoxPro Table

4. Cannot Delete Records in a Joined Table

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

6. Unable to update records in Visual FoxPro Table with ADO-ODBC

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

8. Eliminate records of one table based on another table record count

9. Copy fields from record in table A to record in table B using VBA

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

11. Cannot delete record on FoxPro 2.5 DB

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

 

 
Powered by phpBB® Forum Software