64 bit vbscript to compress Access db

  • I have an old DTS package that exports from a DB2 database located on another server to an Access DB located on the SQL Server 2005 64 bit where the DTS runs from. When I go to compress the Access DB I get:

    Error Code: 0 Error Source= Microsoft VBScript runtime error Error Description: ActiveX component can't create object: 'JRO.JetEngine' Error on Line 0. The step failed.

    The code is

    Set Engine = CreateObject("JRO.JetEngine")

    Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\jobs\mydb.mdb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\JOBS\mydbnew.mdb"

    Set Engine = Nothing

    I tried installing MDAC 2.8, but this didn't help.

  • I don't understand what you mean by Access in SQL Server but you need to look for the WOW64 directory in Windows 2003 because Access comes only in x86 which is 32bits so you must run your code in WOW64. This is what I call the dependent dll issue Access and maybe DB2 are 32bits only SQL Server is 64bits so you need to run the code in 32bits.

    Kind regards,
    Gift Peddie

  • Gift Peddie (2/4/2009)


    I don't understand what you mean by Access in SQL Server but you need to look for the WOW64 directory in Windows 2003 because Access comes only in x86 which is 32bits so you must run your code in WOW64. This is what I call the dependent dll issue Access and maybe DB2 are 32bits only SQL Server is 64bits so you need to run the code in 32bits.

    It's a DTS that exports to an Access DB.

    It sounds like Access needs to be installed on the server? It is not installed on the SQL 2000 32 bit box...

  • You could install Access but you just need the JET Engine per your error and the JET engine is in Sp8. But after that if your 32bits SQL Server 2000 is in Windows 2003 64bits you still need to find with WOW64 directory so your code can run without other issues.

    It is not complicated I am here to help.

    Kind regards,
    Gift Peddie

  • There's is msjet40.dll in c:\windows\syswow64. version is 4.0.9505.0

    ok I try to install Jet 4.0 SP 8 and get a message that it's for a different hardware platform. Must of been 32 bit installer.

    I try to install Jet 4.0 SP ia64 and get a message "...the image file ...update.exe is valid, but is for a machine type other than the current machine.". oops, cpus are AMD Operton's. I don't see an x64 Jet installer.

  • It is not there because Office is still x86 so the one you found it the correct one. Based on your CPU you are running Windows 2003 x64 so see if it is in SP2 because SP2 cleaned up many data access issues.

    So you need to run you code with the Jet engine in WOW64.

    Here is the Microsoft support article that shows in Win2003 you need SP2 to resolve the Jet engine issues.

    http://support.microsoft.com/kb/239114

    Kind regards,
    Gift Peddie

  • ok, I tried putting my original code in syswow64 directory and ran it as cscript comp2.vbs and it worked. The key was to run cscript in that directory, otherwise it must be calling the 64 cscript.

  • That is what I told you in the first reply to look for the WOW64 directory that is where all x86 code runs in 64bits operating system.

    Kind regards,
    Gift Peddie

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply