← HR-Prosoft integration

Connecting HR-Prosoft

HR-Prosoft keeps its data in a SQL Server database, usually on a Windows server in the office. Daslab reads that database directly and only reads it, so you can ask about headcount, payroll, overtime and leave in plain language, in Thai or in English. Setup is three steps: a read-only login, a machine on the same network, and the connection in your workspace.

What you need

  • The address of the SQL Server that holds HR-Prosoft, for example 192.168.1.20:1433, and the name of its database (it often starts with HRMI).
  • Someone who can create SQL Server logins, once.
  • A computer on the same network that stays on. The Windows server HR-Prosoft already runs on is fine.

1. Create a read-only login

Run this on the SQL Server, for example in SQL Server Management Studio, with your own password and database name:

CREATE LOGIN daslab_reader WITH PASSWORD = 'choose-a-strong-password';
USE [HRMI];
CREATE USER daslab_reader FOR LOGIN daslab_reader;
ALTER ROLE db_datareader ADD MEMBER daslab_reader;

db_datareader can read every table and change none of them. Some installations keep earlier years in databases of their own, such as HRMI_2024. Run the last three lines once for each of those you want to ask about, with its name in the USE line.

2. Put a machine on the network

On the Windows server, open PowerShell with Run as administrator and run:

irm https://daslab.run/node.ps1 | iex

Any other computer on the network works too, with curl -fsSL https://daslab.run/node | sh.

This installs Daslab, starts it as a service that comes back after a reboot, and prints a pairing code. Open daslab.run/pair, enter the code and pick your workspace. Under Services it publishes, add one line with a name and the SQL Server's address:

hrmi 192.168.1.20:1433

On the database server, untick Run commands and move files on the same page: carrying the database connection is all it has to do.

The machine connects out to Daslab and accepts no connections itself, so nothing on your network has to be opened to the internet. Through a published service, your workspace reaches that one address and nothing else on the network. You can publish more later on the machine itself with daslab node publish <name> <host:port>.

3. Connect HR-Prosoft in your workspace

In your workspace, connect HR-Prosoft and paste a connection string that names the published service:

mssql://daslab_reader:PASSWORD@hrmi.MACHINE.daslab/HRMI?trustServerCertificate=true

MACHINE is the machine's name as its tile shows it, in lowercase with dashes: office-vm for "Office VM". Most office SQL Servers use a certificate they signed themselves, which is what trustServerCertificate=true is for. If the password contains @, : or /, percent-encode those characters.

The connection belongs to the workspace, so every scene in it can use it. HR-Prosoft holds salaries and personal data: connect it in a workspace whose members should see payroll.

Ask your first question

Table names differ between installations, so the agent looks them up before it writes a query. Names are often stored in Thai and some dates use Buddhist-era years; it checks sample rows before it filters by year. Questions that work well:

  • How many people joined and left each department this year?
  • What did overtime cost each month, by company?
  • Who was paid commission this year, by position, and how much?
  • With your accounting system connected in the same workspace: does September's payroll match what accounting booked?

When the machine is away

If the machine is switched off or restarting, a question says so instead of failing silently. Once the machine is back, the next question reconnects on its own.