Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JRO Clsss Not Registered Error

Status
Not open for further replies.

hitechboy78737

Programmer
Nov 8, 2004
82
US
I have a reference to the JRO class (under the References Folder in the solution explorer) and import it in my class (using "Imports JRO".

When I use JRO.JetEngine.CompactDatabase I get an error from the JetEngine- "Class Not Registered".

Isn't it registered by creating a reference to it in the VS IDE?

This is my code:
Code:
Imports JRO
Imports Scripting

Dim je As New JRO.JetEngine
Dim fso As FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File
Dim tempName As String
Try

 'Make a new File System object.
 fso = New FileSystemObject
 ' Get the FSO Folder (directory) object.
 If Len(dirPath) > 0 Then
  fsoFolder = fso.GetFolder(dirPath)
   For Each fsoFile In fsoFolder.Files
    If fsoFile.Name = objGlobal.gDataName Then
     Dim sourceConn As String = "Provider=" &      objGlobal.gDataProvider & ";Data Source=" & dirPath & "\" & fsoFile.Name & ";"
     Dim destConn As String = "Provider=" & objGlobal.gDataProvider & ";Data Source=" & dirPath & "\tempDb.mdb;"
     je.CompactDatabase(sourceConn, destConn)
     tempName = fsoFile.Name
    End If
   Next fsoFile
  CompactDB = 0
 Else
  MsgBox("Invalid Path")
  CompactDB = -1
 End If
Catch ex As Exception
 MessageBox.Show(ex.Message, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Stop)
Finally
 fso = Nothing
 fsoFolder = Nothing
End Try

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top