By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Test for corrupt tables

P: n/a
Does anyone have a function which can be used to check tables in a db for
corruption?
I want to run such a routine to ensure that backups are not being saved with
corrupt data.

--
Bob Darlington
Brisbane
Oct 4 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hello,

I've wrote a simple command line utility (DBChecker) that can check,
repair and backup a ms-access database file. You can find it at

http://www.webalice.it/barozza/database_checker.htm

I hope it could be right for you.

bye!

Bob Darlington wrote:
Does anyone have a function which can be used to check tables in a db for
corruption?
I want to run such a routine to ensure that backups are not being saved with
corrupt data.


Oct 4 '06 #2

P: n/a
Thanks Alex. I'll give it a run tomorrow.

--
Bob Darlington
Brisbane
"Alex" <b_***********@interfree.itwrote in message
news:79********************************@www.proges is.net...
Hello,

I've wrote a simple command line utility (DBChecker) that can check,
repair and backup a ms-access database file. You can find it at
http://www.webalice.it/barozza/database_checker.htm

I hope it could be right for you.

bye!

Bob Darlington wrote:
>Does anyone have a function which can be used to check tables in a db for
corruption?
I want to run such a routine to ensure that backups are not being saved
with corrupt data.



Oct 5 '06 #3

P: n/a
Bob Darlington wrote:
Does anyone have a function which can be used to check tables in a db for
corruption?
I want to run such a routine to ensure that backups are not being saved with
corrupt data.
FWIW I use the code below to scan a single table for bad records. It's
set up to send output to a form, but you could easily modify it to
debug.print.

Public Sub FindBadRecord()
On Error GoTo ErrBadRecord
Dim RS As DAO.Recordset
Dim i As Long
Dim j As Long
Dim tmpx As Variant
Dim SQL As String
With Form_frmDebugger.txtDebugWindow
.Text = "Running..." & vbCrLf
SQL = "SELECT * " & _
"FROM [MyTable]" & _
"ORDER BY [MyTable].[RecID];"
Set RS = CurrentDb.OpenRecordset(SQL)
RS.MoveFirst
Do While Not RS.EOF
' Debug.Print "Reading fields at record # " & RS.Fields(0)
j = j + 1
If j Mod 1000 = 0 Then .Value = .Value & "Read " & j & "
records OK."
For i = 0 To RS.Fields.Count - 1
tmpx = RS.Fields(i).Value
Next i
ResumeBadRecord:
RS.MoveNext
DoEvents
Loop
.Text = .Value & "Done" & vbCrLf
Set RS = Nothing
Exit Sub
ErrBadRecord:
.Text = .Value & "*** Error at [RecID] " &
RS.Fields(0).Value & vbCrLf
.Text = .Value & "*** Error details: " & Err & " " & Error &
vbCrLf
.Text = .Value & vbCrLf
Resume ResumeBadRecord
End With
End Sub

--
Smartin
Oct 5 '06 #4

P: n/a
Alex,
Sorry about the delay getting back to you.
Many thanks for your solution. It was exactly what I was looking for.

--
Bob Darlington
Brisbane
"Alex" <b_***********@interfree.itwrote in message
news:79********************************@www.proges is.net...
Hello,

I've wrote a simple command line utility (DBChecker) that can check,
repair and backup a ms-access database file. You can find it at
http://www.webalice.it/barozza/database_checker.htm

I hope it could be right for you.

bye!

Bob Darlington wrote:
>Does anyone have a function which can be used to check tables in a db for
corruption?
I want to run such a routine to ensure that backups are not being saved
with corrupt data.



Oct 16 '06 #5

P: n/a
Bob Darlington ha scritto:
Alex,
Sorry about the delay getting back to you.
Many thanks for your solution. It was exactly what I was looking for.
OK Bob, you're welcome!
bye, Alex

--

questo articolo e` stato inviato via web dal servizio gratuito
http://www.newsland.it/news segnala gli abusi ad ab***@newsland.it
Oct 19 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.