Connection String to Silent ODBC DSN using ProvideX ODBC Driver is forcing connection to default to SOTAMAS90 DSN

SUGGESTED

We are querying invoice data to read from MAS using the ProvideX ODBC driver from within a custom application.  Within the custom application, we have tried specifying credentials explicitly within the connection string used to open the ODBC connection but we are finding that the driver appears to be using the default SOTAMAS90 DSN even when we specify a different Silent Connection (https://support.na.sage.com/selfservice/viewContent.do?externalId=19495&sliceId=1) DSN or specify a connection string that doesn't specify a particular DSN but does supply credentials.  This is a problem because any time the Sage application is launched from the same workstation, the saved credentials within the ODBC connection for the SOTAMAS90 DSN get cleared out and the user is prompted for this login information at runtime when running the custom application.  if we edit the SOTAMAS90 DSN by supplying it with valid user credentials the problem goes away and the user can run our custom application without being prompted, but as soon as Sage is relaunched the credentials get cleared out again and the user gets prompted once again.  How can we establish a connection string within our application to the Silent Connection and have it actually connect to the Silent Connection and not the default SOTAMAS90 DSN?

Parents Reply Children
  • 0 in reply to K. Koop

    Hi You can try a DSN-Less ODBC Connection string

    i.e.

    Driver={MAS 90 4.0 ODBC Driver}; Company = ABC; UID=ALL; PWD='' Directory=C:\Sage\Sage 100 Standard\MAS90; LogFile=\PVXODBC.LOG; CacheSize=4; DirtyReads=1; BurstMode=1; StripTrailingSpaces=1; SERVER=NotTheServer

    The SOTAMAS90 DSN should not be used for any third party ODBC access.  The DSN is recreated on each startup of Sage 100.

    John Nichols

    Sage

  • 0 in reply to K. Koop
    SUGGESTED

    It's been some time since I've worked with VB6, but the following code snippet is what we used to use in our VB.NET apps when accessing Sage data..  It dynamically builds a connection string depending on if the install is Standard or Advanced (C/S).  

    Perhaps, you can re-tool it to fit in VB6.

    Dim constr As String = ""


    If CBool(My.Settings.CS) Then
    constr = constr & "DSN=SOTAMAS90; Directory="
    constr = constr & My.Settings.SageInstall
    constr = constr & "; Prefix="
    constr = constr & My.Settings.SageInstall
    constr = constr & "\SY\, "
    constr = constr & My.Settings.SageInstall
    constr = constr & "\==\; ViewDLL="
    constr = constr & My.Settings.SageInstall
    constr = constr & "\HOME; LogFile=\PVXODBC.LOG; RemotePVKIOHost="
    constr = constr & My.Settings.SageServerName
    constr = constr & "; RemotePVKIOPort="
    constr = constr & My.Settings.SagePort
    constr = constr & "; CacheSize=4; DirtyReads=1; BurstMode=1; StripTrailingSpaces=1; SERVER=NotTheServer"
    constr = constr & ";UID=" & My.Settings.SageUserName & ";PWD=" & My.Settings.SagePassword & ";Company=" & CompanyCode
    Else
    constr = constr & "DSN=SOTAMAS90; Directory="
    constr = constr & My.Settings.SageInstall
    constr = constr & ";UID=" & My.Settings.SageUserName & ";PWD=" & My.Settings.SagePassword & ";Company=" & CompanyCode
    End If


    Dim con As System.Data.Odbc.OdbcConnection = New Data.Odbc.OdbcConnection(constr)

  • 0 in reply to jcnichols

    Thanks for the suggestion.  We've tried forgoing the DSN and using the driver specification previously, however when we had we had not included curly brackets around the driver name.  I should be able to give that a try later today

  • 0 in reply to K. Koop

    I am afraid that using the syntax with curly braces around the "Driver" variable did not resolve the issues we are seeing.

  • 0 in reply to K. Koop

    Did you try Kevin's suggesting to make sure you first get a working connection string in another application, such as Excel or Crystal Reports? 

    Are you sure you are passing a valid company code that exists in the Sage 100 install? We have been using ABC as an example because its demo data can be optionally installed when Sage 100 is installed but it could have been deleted after the fact or never installed in the first place.

  • 0 in reply to David Speck

    Hi David,  yes, we have been able to verify connection strings do work in Excel (without a login prompt) and the company code we've been using in the connection string is the one applicable to the environment and not "ABC" as in the example.

  • 0 in reply to K. Koop

    Search your VB6 project for any reference to SOTAMAS90.  There should be none.  It could be there is something buried which is still pointing at that instead of your new DSN.