If you need to empty/truncate all user data from an MS Access database, the following VB script should do the job:
Public Sub TruncateTables()
On Error GoTo Error_TruncateTables
Dim DB As DAO.Database
Dim TDF As DAO.TableDef
Dim strSQL_DELETE As String
Set DB = CurrentDb()
For Each TDF In DB.TableDefs
If Left(TDF.Name, 4) <> "MSys" Then
If Left(TDF.Name, 1) <> "~" Then
strSQL_DELETE = "DELETE FROM " & TDF.Name & ";"
MsgBox "Tables have been truncated", vbInformation, "TABLES TRUNCATED"
Set TDF = Nothing
Set DB = Nothing
Select Case Err.Number
Resume Next 'Ignore error if table not found
Case 3270 'Property Not Found
MsgBox Err.Number & ": " & Err.Description
Happy coding… Tweet
As a developer, I tend to use VMs extensively to test new features and deploy software that I wouldn’t like running on my main machine. VMware is brilliant in that it offers a free tool to create and run VMs – VMware Player. As handy and great VMs are, they are also quite volatile and [...]
I added a project to the wrong TFS collection! Now what? Removed all the bindings from my solution but the TFS service now points to an orphaned entry. Unfortunately, up to this day, the TFS team have not been kind enough to supply us with a GUI tool that can delete a project from the [...]
After spending 3 hours of my life trying to resolve the following error message: The element cannot contain white space. Content model is empty I decided to share my solution in hope that this will help somebody else. The xml file that was failing validation is:
<?xml version="1.0" encoding="utf-8"?>
<ComponentSet Default="Create Data Set">
<Procedure Name="Create Data Set">
<CreateDataSetVersion Name="run create data set version task"
Description="this the description"
And the xsd part responsible for the validation [...]
Many websites still make use of lengthy scrollable forms or numerous page post backs when requesting input from their users, e.g shopping cart check outs etc. jQuery and jQueryUI give developers the opportunity to significantly improve the overall UI experience. In this tutorial, we will look into creating sliding panels/divs that respond to user input [...]
Many developers have been caught up by this error message judging by the number of posts on StackOveflow! I had to fight with this exception for a few hours until the solution popped out to remind me that losing focus is never a good thing! After having a working prototype, I tried to integrate the [...]
This is a common issue for many developers. How do you quickly and efficiently determine whether a given non-null collection contains any valid non-empty elements . The string class is cool because you can use the string.IsNullOrEmpty(yourstring); to test for null and/or empty. Unfortunately, generic collections don’t implement a similar method. There are two ways [...]
With the advent of HTML5 and its wide adoption by all major browsers, web developers now have a new arsenal in their hands for implementing powerful file upload functionality on their website. In this tutorial we will see how to implement this using the FileDrop jQuery plugin and an MVC controller to receive and store [...]
NLog is an awesome open-source logging tool that allows developers to easily and efficiently implement custom logging. Nlog can be configured to log to a number of targets, but on this tutorial we will be looking at logging to the database. First you need to add NLog to your MVC website. Bring up the Nuget package [...]