473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

permanent delete in linked table

232 New Member
i have a dbf file which i linked in access and running sql query through vba but delete query only marks for deletion.is there any method to delete this record permanently as in foxpro after deletion we use pack to permanently delete a record.every time after running vba program i have to open foxpro use file and then pack to delete record permanently.
Apr 8 '15 #1
1 1968
zmbd
5,501 Recognized Expert Moderator Expert
It appears that this is not directly possible from within MSAccess. You can mark the records for deletion... you can even set a flag in the local registry for MSAccess to ignore the marked records; however, there doesn't appear to be anyway to issue the PACK command from within VBA or ODBC.

I'll take another walk thru the internet to see if something pops up... would be helpful to know what OS and version of Office/Access/FoxPro you are using.


[Update]
Option 1:
If you have the VfpOleDB.dll (MS link for v9)

Expand|Select|Wrap|Line Numbers
  1.    Dim cn As ADODB.Connection
  2.    Dim strPath as String
  3.    strPath = "your file's path"
  4.    Set cn = New ADODB.Connection
  5.    cn.Open ("Provider=vfpoledb.1;Data Source= strPath")
  6.    '
  7.    With cn
  8.       If .STATE = adStateOpen Then .Close
  9.       .Open
  10.       .Execute "PACK name_of_database.dbf"
  11.    End With
  12.    cn.Close
  13.    Set cn = Nothing
Option 2:
This is a VB workaround. Often VB can be modified to work within the VBA environment.
Unfortunately I do not have a FoxPro installation to check the functionality of the following: Support-Microsoft:How to ZAP or PACK a dBASE or FoxPro Table

The workaround requires an INI setting be made and then either uses a copy of at template file and the insert method or creates a temporary table, moves the good records, deletes the current table, renames the temporary table, finally refreshes the linked tables. I don't know how that will work in VBA and FoxPro.
Apr 18 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2100
by: me here | last post by:
I have a VBA subroutine that links an MS Excel spreadsheet and copies the data into a local table. This process is controlled by a form that allows users to select the spreadsheet from the file...
5
4453
by: deko | last post by:
How to run action query against linked table? I have an Access 2003 mdb with an Excel 2003 Workbook as a linked table. When I attempt to run an action query against the linked table I get this...
0
1514
by: Brad | last post by:
Thanks for taking the time to read my question. I have a split DB and I want to be able to delete the old table, copy an existing table that is in the back end, rename it, and then make sure all...
2
1568
by: jkw | last post by:
Hi - I created a linked table via ODBC to a SQL Server database. The table in SQL Server contained over 12,000,000 records. Later, I started a "Delete" query. When I realized that I was deleting...
2
3363
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
2
2374
by: troy_lee | last post by:
What is the best way of copying all the records from a linked table into a replica table that is local on my computer? This is for development work at home where I can not access the main table. Is...
0
1139
by: Duke Slater | last post by:
I have a user who has created an Access 2007 database with one linked table to SQL Server 2005. He wants to purge the linked table and repopulate it, but gets the 3086 error when running a delete...
12
12614
by: Joel Marion | last post by:
I have a linked table that is being imported from Excel, with the data being exported from a source I cannot control. The incoming table contains a heading in row 1 that only has text in the first...
2
3393
by: Chary314 | last post by:
Dear all, I just spent quite a lot of time investigating one problem, which seems to be a bug (which I wasn't able to google). So I am just posting a bug report here: BUG REPORT: PROBLEM...
8
2736
by: parkin13 | last post by:
Hello - I have an issue with Access after upgrading to 2010. It seems to impact all databases and they are working for others. Whenever I attempt to enter the "Linked Table Manager" either via...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.