We help IT Professionals succeed at work.

Where can I find a repository of SAGE 100 Scripts which can run .vbs using ODBC

Tek Info
Tek Info asked
on
Where can I find a repository of SAGE 100 scripts which can run in .vbs using ODBC?
Comment
Watch Question

Scott FellDeveloper & EE Moderator
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
I think what you want to check out are the API's https://developer.columbus.sage.com/docs/services/api/global if that is what you are after.  From there Experts can help with a specific api assuming you have some experience with  with vbs.  In short, most API's are either going to be REST or SOAP. Either way, you can send POST and GET requests using  xmlhttpost. The best way to get help is work on something very specific. If you are just starting out, your starting point may just be getting an access token.  Once you have that, you can create a new question for the next step.

Author

Commented:
Thanks Scott.
I checked however it does not seem what I am looking for...
I use SAGE 100 and I am simply looking for sample .vbs script which can be used with OBDC so that I can extract data our of SAGE and perhaps form a CSV file of the several fields etc.
I need somewhere to start
Developer & EE Moderator
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013
Commented:
It looks like this is 3 parts.  First is creating the connection. I am not a sage user, but I found some helpful info
https://support.na.sage.com/selfservice/viewContent.do?externalId=51211&sliceId=1
https://www.sagecity.com/support_communities/sage100_erp/f/sage-100-technical-and-installation-discussions/72832/sage-100-client-server-odbc-setup 
https://www.sagecity.com/support_communities/sage100_erp/f/sage-100-technical-and-installation-discussions/91657/odbc-driver-registration-window

Getting the first part done may be worth it's own question and probably going to be the biggest hurdle.

The 2nd part is figuring out the correct connection string https://www.sagecity.com/support_communities/sage100_erp/f/sage-100-technical-and-installation-discussions/39104/odbc-connection-string with the possible solution
strConnectionString = "DSN=J_SOTAMAS90;UID=xxx|ABC;PWD=xxxx;Directory=C:\Sage Software\Clean\MAS90;LogFile=\PVXODBC.LOG;DirtyReads=1;BurstMode=1;StripTrailingSpaces=1;SERVER=NotTh

Open in new window


The third part is coding the script. Once the first two parts are figured out, this is just a matter of knowing the fields you want to access.

https://docs.microsoft.com/en-us/sql/ado/guide/appendixes/vbscript-ado-programming?view=sql-server-ver15 
<%  @LANGUAGE="VBSCRIPT" %>  
<%  Option Explicit %>  
<!--#include File="adovbs.inc"-->  
<HTML>  
    <BODY BGCOLOR="White" topmargin="10" leftmargin="10">  
  
    <!-- Your ASP Code goes here -->  
<%  
Dim Source  
Dim Connect  
Dim Rs1  
  
Source = "SELECT * FROM Authors"  
Connect = "Provider=sqloledb;Data Source=srv;" & _  
    "Initial Catalog=Pubs;Integrated Security=SSPI;"  
  
Set Rs1 = Server.CreateObject( "ADODB.Recordset" )  
Rs1.Open Source, Connect, adOpenForwardOnly  
Response.Write("Success!")  
%>  
    </BODY>  
</HTML>  

Open in new window

This example shows rendering an ASP page but you can of course leave out the html.  Where the example shows
Connect = "Provider=sqloledb;Data Source=srv;" & _  
    "Initial Catalog=Pubs;Integrated Security=SSPI;"  

Open in new window

That will be the connection string from step 2.

I hope this at least helps you get started.  I am sorry I can't be more detailed as I do not have a copy of Sage to play with.  Just take it one step at a time.

Author

Commented:
Perhaps this might be helpful, I have not tested it.