How to connect to Sage 100

SUGGESTED

I am developing a Windows Forms application which is required to connect to Sage 100 and get order information. I am using ASP.NET and SQL Server 2008.

Is there a way to connect to the sage 100 database?

myprepaidcenter login

  • 0
    SUGGESTED

    You can query data using the ODBC driver for Sage 100 or by using the Business Object Interface's COM object to read/write data.

    The ODBC route is the simplest way to go if you have access to the driver which is installed along with the Sage 100 Workstation.  You can optionally install the 64 bit version of the driver as well.  You can use either the default SOTAMAS90 DSN or you can use a connection string where you specify the driver and all of the required parameters. 

    If you use the DSN, you only need the following connection string but you need to supply the values for the UID, PWD, and Company parameters.

    DSN=SOTAMAS90; UID=user; PWD=password; Company=ABC;

    If you use the driver, the easiest way to build the correct connection string is to open the ODBC Data Source Administrator (32 bit) and select the SOTAMAS90 DSN then click Configure.  Go to the Debug tab and click Connection String.  This should give you something like the following.

    DSN=SOTAMAS90; Directory=C:\Sage\Sage 100 2018\MAS90; Prefix=C:\Sage\Sage 100 2018\MAS90\SY\, C:\Sage\Sage 100 2018\MAS90\==\; ViewDLL=C:\Sage\Sage 100 2018\MAS90\HOME; LogFile=\PVXODBC.LOG; CacheSize=4; DirtyReads=1; BurstMode=1; StripTrailingSpaces=1; SILENT=1; SERVER=NotTheServer

    You need to replace "DSN=SOTAMAS90" with "driver={MAS 90 4.0 ODBC Driver}" and then add the UID, PWD, and Company parameters so it should look like this.

    driver={MAS 90 4.0 ODBC Driver}; UID=user PWD=password; Company=ABC; Directory=C:\Sage\Sage 100 2018\MAS90; Prefix=C:\Sage\Sage 100 2018\MAS90\SY\, C:\Sage\Sage 100 2018\MAS90\==\; ViewDLL=C:\Sage\Sage 100 2018\MAS90\HOME; LogFile=\PVXODBC.LOG; CacheSize=4; DirtyReads=1; BurstMode=1; StripTrailingSpaces=1; SILENT=1; SERVER=NotTheServer

    You can refer to the following links for more info on the odbc driver.

    Using the PxPlus SQL ODBC Driver (pvxplus.com)

    SQL Syntax Table (pvxplus.com)

    Scalar Functions (pvxplus.com)

    Example SQL (pvxplus.com)

    You can also use an Access database with Passthrough queries set up or a SQL Server Linked Server if you prefer to work with either of those SQL syntaxes.

    If you decide to go the BOI route, there are a bunch of examples on this forum and you can find additional resources for table layouts and object information at the following link.  

    Sage 100 File Layouts and Object Reference - Sage 100 File Layouts and Object Reference

    There is also a BOI class on Sage U.

  • 0

    On the Basic tab, Give the DS a name and description, then enter the database directory. Just as the dialog box says, it should be the directory that contains your PROVIDEX. DDF file in your Sage 100 installation. On the Logon tab, enter the company code, user ID and password for the company you want to access.