473,569 Members | 2,438 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 1984
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
2107
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 system. I actually import from two different named ranges from each workbook so for every import the following subroutine is used twice. The database...
5
4461
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 error: Deleting data in a linked table is not supported by this ISAM. From what I understand, indexed sequential access method (ISAM) drivers are...
0
1525
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 my links are still in tact. Right now I seem to be just doing this to my table links in my front end. Is this possible? Here is my code:
2
1574
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 from the SQL Server, I panicked and tried to stop the query. Esc didn't work, so I killed Access with Ctrl-Alt-Del (task manager). Is there any...
2
3367
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 table today, it is linked as a text(255) field, ditto for the first table if I link it today if I link the 2nd table using access2003 (and the same...
2
2382
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 a macro the best way to handle this? Thanks in advance. Troy Lee
0
1152
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 statement. I might think the syntax is wrong, but when opening the table in Access the delete option is disabled (but only on the linked table). He...
12
12641
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 cell followed by blank cells, with the column names in row 2. I am currently manually deleting this first row before importing/linking the table, but I...
2
3408
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 DESCRIPTION: Not possible to re-link Linked table after unsuccessful connection to a table, which has Memo field with Append Only flag, set to Y. On...
8
2744
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 the External Data tab or by right clicking on a table and selecting "Linked Table Manager" I get the following error... "The Database cannot be...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.