1 Reply Latest reply on Mar 23, 2016 1:03 PM by 3196020

    FDMEE vb script

    2806073

      How i can pass the sql server db login credentials in a fdmee Vb script using the fdm api functions

       

       

      Currently this is my vb connect statement

       

       

      Set Connect = CreateObject("ADODB.Connection")

      conStr = "Provider=SQLOLEDB;Data Source=MRSQL36\NI1;Initial Catalog=FDMEE;Userid=Sat;Password=Password1" - is this a correct way of calling the sql server credentials in the FDMEE vb script editor

      Connect.Open = conStr

       

       

      When ever i try to execute the vb script iam getting an error "clsAppServerDM.fInitializeMainAPI: Unable to connect to database.  Please check database information and verify database is accessible.

      "

      016-03-22 13:44:05,852 ERROR [AIF]: The script has failed to execute:

      2016-03-22 13:44:05,867 INFO  [AIF]: \\HYDEV\APPDATA\FDMEE\data\scripts\event\BefImport.vbs(20, 1) clsAppServerDM.fInitializeMainAPI: Unable to connect to database.  Please check database information and verify database is accessible   and after that i need to select table from sql server database ,load the data from the  into fdmee for the location TL  or is there any specific way of calling the database and doing the select query using any one of fdmee VB api functions

       

       

      '************************************************************************************

      'REVIEW INPUT PARAMETERS

      '************************************************************************************

      If WScript.Arguments.Count <> 5 Then

      Wscript.Echo "You must supply 5 runtime variables." & vbNewLine & "Usage:HFM_LOAD.vbs LoadID CSS_Token OracleInstancePath JavaHomePath OLE_DB_PROVIDER"

      WSCript.Quit -1

      Else

      LoadID = Wscript.Arguments.Item(0)

      CSSToken = WScript.Arguments.Item(1)

      OracleInstancePath = WScript.Arguments.Item(2)

      JavaHomePath = WScript.Arguments.Item(3)

      Provider = WScript.Arguments.Item(4)

      End If

      '************************************************************************************

      '************************************************************************************

      'Initialize FDMEE VB API

      '************************************************************************************

      Set objFDMAPI = CreateObject("fdmapi.clsAppServerDM")

      WScript.Echo "FDMEE VB API created."

      blnInit = objFDMAPI.fInitializeMainAPI(CStr(LoadID), CStr(CSSToken),CStr(OracleInstancePath), CStr(JavaHomePath), CStr(Provider))

      If blnInit Then

      WScript.Echo "FDMEE VB API initialized."

      Else

      WScript.Quit -1

      WScript.Echo "fInitializeMainAPI failed."

      End If

       

       

      Set Connect = CreateObject("ADODB.Connection")

      conStr = "Provider=SQLOLEDB;Data Source=MRSQL36\NI1;Initial Catalog=FDMEE;Userid=Sat;Password=Password1"

      Connect.Open = conStr

      Dim strSql

      strLoc = objFDMAPI.API.State.LocName

      strCat = objFDMAPI.API.State.CatName

      'Check for Location.

      If strLoc ="TL"  Then

      strSql="SELECT * FROM TLLOAD WHERE Location = 'TL'" " AND Category ='ACT'" -is this correct of selecting a query using  the FDMEE functions

      End If

      objFDMAPI.Dispose

      Set objFDMAPI= Nothing

        • 1. Re: FDMEE vb script
          3196020

          Which version are you on and what is the OS(Is it Win 2012 R2)?Have you tried running a VBScript using some other fdm API.We are already in touch with Oracle as there seems to be some issues with fdmAPI.dll file and fdm API's are not getting initialized in v 11.1.2.4.