Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: VBScript Error in SQL2000

    hi

    I have a VBScript converted from an AccessDB Macro to VB.

    Option Compare Database

    '------------------------------------------------------------
    ' Macro2_Export2Text5
    '
    '------------------------------------------------------------
    Function Macro2_Export2Text5()
    On Error GoTo Macro2_Export2Text5_Err

    DoCmd.TransferText acExportDelim, "", "MTHCrosstabCountingUnits", "c:\IMS\MthCountingUnit.txt", True, ""
    DoCmd.TransferText acExportDelim, "", "MTHCrosstabValue", "c:\IMS\MTHValue.txt", True, ""
    DoCmd.TransferText acExportDelim, "", "MATCrosstabValue", "c:\IMS\MatValue.txt", True, ""
    DoCmd.TransferText acExportDelim, "", "MATCrosstabCountingUnits", "c:\IMS\MATCountingUnit.txt", True, ""


    Macro2_Export2Text5_Exit:
    Exit Function

    Macro2_Export2Text5_Err:
    MsgBox Error$
    Resume Macro2_Export2Text5_Exit

    End Function

    What I am trying to do is instead of Opening the Access application and run the macro manually, i converted the macro to VB and created an ActiveX Script Task package in SQL2000 and Copy and Paste the VB Code to ActiveX Script Task. But it didn't work. Is there a work around for this?

    Many thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    not being a vbscript guy i can tell you what i know about access
    it appears that you are using docmd which i believe is not vbscript compatible
    i think that it is just an access command.
    so it is VBA not VB or VBScript.

    just an observation.

    what are you trying to accomplish?

  3. #3
    Join Date
    Mar 2004
    Posts
    2
    yes you are right. It was converted from a Access2000 macro and is VBA.

    Actually i want to automate the process of executing an Access 2000 macro using DTS.

    There wasn't any task that allows me to execute an Access macro, therefore I converted it to VBA and then copy and paste the code to DTS using executing ActiveX Script Task.

    Is there any workaround?

    Many thanks in advance.

  4. #4
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    i cant really help you with the vbscript but i can tell you that on the sql server side... you should create a script and run a job.to execute that script
    that will work with no problem.

    my suggestion as far as vbscript is to go to the vbscript forums located here and you might want to lurk the access forum as well.

    wish i could help but my vb scripting skills are minimal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •