If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Undelete table
Hi:
I have a problem with a database in access 2k. Somebody erased a table by mistake, the database hasn't been shrunk yet, is there a way to get the table back? Thanks |
#2
|
|||
|
|||
You might do a Google search for "data recovery" to see if you can locate an
Access data recovery business that can do it for you. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm Jeff Conrad's Access Junkie List: http://home.bendbroadband.com/conrad...essjunkie.html "Mauro Chojrin" wrote in message ... Hi: I have a problem with a database in access 2k. Somebody erased a table by mistake, the database hasn't been shrunk yet, is there a way to get the table back? Thanks |
#3
|
|||
|
|||
Mauro
If you haven't closed the db or Access, there's a way to undelete a table (NOTE: this does not apply if records were deleted from a table, but the table structure left intact). There's a KB article (209874) that describes one way to do this. Here's some (sample -- no guarantees) code that extends the idea to recover multiple deleted tables. You'll need to set a reference to DAO 3.6, and you'll need to watch for line-wrap. Again, this will only work if you have a table deleted, no Compact & Repair, and have not closed the database or Access. Good luck! Jeff Boyce Access MVP '***Begin sample code*** '20050607 ' Copyright, Jeff Boyce ' Information Futures ' Microsoft Access MVP Function RecoverDeletedTable() ' Purpose: recover deleted table(s) BEFORE closing Access ' Changed: 06/07/2005 -- adapted from Microsoft KB 209874 ' Tested: Access 2002 ' Requires: reference to DAO 3.6 On Error GoTo ExitHere '*Declarations* Dim db As DAO.Database Dim strTableName As String Dim strSQL As String Dim intCount As Integer Dim blnRestored As Boolean '*Init* Set db = CurrentDb() '*Procedure* For intCount = 0 To db.TableDefs.Count - 1 strTableName = db.TableDefs(intCount).Name If Left(strTableName, 4) = "~tmp" Then strSQL = "SELECT DISTINCTROW [" & strTableName & "].* ” _ "INTO " & Mid(strTableName, 5) & " FROM [" & strTableName & ];" DoCmd.SetWarnings False DoCmd.RunSQL strSQL MsgBox "A deleted table has been restored, using the name '" & Mid(strTableName, 5) & "'", vbOKOnly, "Restored" blnRestored = True End If Next intCount If blnRestored = False Then MsgBox "No recoverable tables found", vbOKOnly End If '*EXIT/ERROR* ExitHe DoCmd.SetWarnings True Set db = Nothing Exit Function ErrorHandler: MsgBox Err.Description Resume ExitHere End Function '***End sample code*** "Mauro Chojrin" wrote in message ... Hi: I have a problem with a database in access 2k. Somebody erased a table by mistake, the database hasn't been shrunk yet, is there a way to get the table back? Thanks |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get data from combo box to popluate the next box | Lin Light | Using Forms | 4 | December 30th, 2004 05:01 PM |
transpose | john | Using Forms | 1 | November 24th, 2004 06:16 PM |
Automatic filling of fields in table two from table one | Jim Kelly | Database Design | 1 | September 27th, 2004 10:16 PM |
Complicated Databse w/many relationships | Søren | Database Design | 7 | July 13th, 2004 05:41 AM |
COMPARE THE TWO TABLES | Stefanie | General Discussion | 0 | June 4th, 2004 04:36 PM |