Inventory Script for Sage 100 ERP 2015 Premium SQL

Hi,

I am trying to update a Script that worked in MAS 200 Version 4.5 (NON SQL). We've upgrade to Sage 100 ERP 2015 Premium (SQL) and now it does not work. Here is a copy of the script that worked when a button was clicked in Inventory Maintenance. When the button is clicked a custom report would launch.

Dim App, RptFile, RptWindow, User, Comp, Pw, Dest, RptSelect
Dim Rept, Login, ExportOpt, DSNstring, DBOpt
User = "ads"
Comp = MAS_SCR_CMP
PW = "test"

'Report File: Change to the full path and file name
RptFile = "\\mas01\MASV44\MAS90\Reports\InvCommitted.rpt"

'Destination Print or Preview, set it to 1 for Print and 0 to Preview
Dest = 0

'Report Selection
RptSelect = "{SO_SalesOrderDetail.ItemCode} = '"+CI_ItemCode_bus_ItemCode+"'"

Set objShell = CreateObject("WScript.Shell")
RegLocate = "HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\SOTAMAS90\"
objShell.RegWrite RegLocate & "UID", User
objShell.RegWrite RegLocate & "PWD", PW
objShell.RegWrite RegLocate & "COMPANY", Comp
Set objShell = Nothing

Set App = CreateObject("CrystalRuntime.Application")
Login = App.LogOnServerEx("p2sodbc.dll", "SOTAMAS90")
Set Rept = App.OpenReport (RptFile)

Set ExportOpt = Rept.ExportOptions
Set DBOpt = Rept.Database

ExportOpt.FormatType = 31
ExportOpt.DestinationType = 1
ExportOpt.PDFExportAllPages = True
ExportOpt.DiskFileName = "\\mas01\MASV44\MAS90\Reports\comminv_" & MAS_SCR_USR & ".pdf"

If Not Isnull(RptSelect) then
Rept.RecordSelectionFormula = RptSelect
End if

RptWindow = "Committed Detail Report"

if Dest = 1 then
Rept.PrintOut
else
Rept.Export False
end if

Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "\\mas01\MASV44\MAS90\Reports\comminv_" & MAS_SCR_USR & ".pdf"
Set objShell = Nothing

Now it does now it does not work since Sage has been upgraded to SQL. Now, we get the following message:

It seems to error out at line 50: Login = App.LogOnServerEx("p2sodbc.dll", "SOTAMAS90")

Any help would be appreciated.