Macros and Programming


CardboxForumsMacros and Programming > "Macro fails trying to convert fractal images in a CB database"

Macro fails trying to convert fractal images in a CB database

UpgradeFractals.cbs stops and gives an error message: advice requested

Posted By Post


9-Mar-2009 21:11

I am trying to convert fractal images held in a Cardbox database to JPG and I have followed the advice at http://www.cardbox.com/support/kb/fractals.htm to do this.

When I run the macro UpgradeFractals.cbs in CB Version 3.0 (build 4274) under Vista Business on a 64-bit platform in a database that has several fractal images in it, the macro stops with the error message:

2382/14331: 4 scanned, 0 fractal.
Command failed.
Unspecified error (80004005).
(Position in the macro: line 24, character 5)

This error message is consistent and occurs each time I run the macro. Record 2382 does not have any fractals in it. I have tried running CB as Administrator, then the macro, but this did not help. It also fails when the 'Kaspersky' Virus checker is disabled.

The macro, which I cut and pasted from http://www.cardbox.com/support/macros/UpgradeFractals.cbs is:

' Description: Look for fractal images and upgrade any that are found.
Dim iRec,nRecs,nImgs,nFractals

Sub UpdateStatus
StatusText="" & iRec & "/" & nRecs & ": " & nImgs & " scanned, " & nFractals & " fractal."
End Sub

Set recs=Database.AllRecords
For iRec=1 To nRecs
 Set rec=recs(iRec)
 Set imgs=rec.Images
 For i=1 to n
  Set img=imgs(i)
  If img.IsFractal Then
    If bEditing=0 Then
      End If
    imgs.Add img.Picture
    imgs.MoveFromTo imgs.Count,i
    imgs.MoveFromTo i+1,imgs.Count
    imgs.Remove imgs.Count
   End If
 If bEditing Then
   End If
MsgBox "Records scanned: " & nRecs & vbCrLf & "Images scanned: " & nImgs & vbCrLf & "Fractal images converted:" & nFractals

Advice on how to proceed would be appreciated.

Christopher Spry


9-Mar-2009 22:03

The macro works correctly when I ran it on the same database and with the same version of CB on a 32-bit XP Sp2 PC. It seems that Vista 64 is the cause of the problem.

Christopher Spry

© 2010 Cardbox Software Limited   Home