There is one database, hosted by SQL Server on a single computer (the “server”). Every POS counter runs the NovaPharma app and connects to that one database over the LAN, so stock, sales and reports are shared live across all counters.
| Item | Requirement |
|---|---|
| Server IP address | Give the server PC a static (fixed) IP or a DHCP reservation — e.g. 192.168.1.10. Clients connect by this address (or the PC name), so it must not change. |
| Same network | All counters and the server must be on the same LAN / subnet (same router/switch). |
| Connection | Wired Ethernet is recommended for the server and busy counters; Wi-Fi works but is less reliable. |
| SQL Server port | TCP 1433 open on the server's firewall for the local subnet (the setup script does this). |
| Network profile | The server's network should be set to Private (not Public), so LAN sharing is allowed. |
Do this once, on the PC that will hold the database.
NovaPharma ships with Install-NovaPharmaSqlServer.ps1. Run it in an elevated PowerShell (Run as administrator) on the server. It uses the SQL Server Express installed by the setup (or downloads it if you skipped that option), enables TCP/IP on port 1433, turns on Mixed-Mode authentication, creates the app login, creates the NovaPharma database, and opens the firewall for the local subnet.
It will prompt for a strong password (16+ chars) for the SQL login novapharma_app. Useful switches:
| Switch | Effect |
|---|---|
| -StoreCurrentUserConnection | Also saves NOVAPHARMA_CONNECTION and NOVAPHARMA_TERMINAL (POS-01) for this user, so the server PC can double as a counter. |
| -TcpPort 1433 | SQL Server TCP port (default 1433). |
| -SqlLogin novapharma_app | Name of the SQL login the clients use. |
| -TrustedNetworkName "Shop LAN" | Switches that network to the Private profile automatically. |
If you prefer to do it by hand, or already run SQL Server:
Repeat on every counter that will connect to the server.
NovaPharma reads two environment variables. Set them per Windows user with setx (open a new Command Prompt afterwards so they take effect):
| Scenario | NOVAPHARMA_CONNECTION |
|---|---|
| Networked counter → server (SQL login) | Data Source=tcp:192.168.1.10,1433;Initial Catalog=NovaPharma;User ID=novapharma_app;Password=•••;Encrypt=True;TrustServerCertificate=True |
| Same workgroup, Windows auth | Data Source=tcp:SERVER-PC,1433;Initial Catalog=NovaPharma;Integrated Security=SSPI;Encrypt=True;TrustServerCertificate=True |
| Standalone (single PC) | Not needed — defaults to localhost\SQLEXPRESS with Windows authentication. |
Check, in order:
ping 192.168.1.10Test-NetConnection 192.168.1.10 -Port 1433 (PowerShell) should say TcpTestSucceeded: True.That message appears only when NOVAPHARMA_CONNECTION is not set and no local SQL Server exists. Set the connection string (Section 4) and reopen a new session so it loads.
The server must be in Mixed-Mode auth and the login enabled with the correct password and db_datareader/db_datawriter on the NovaPharma database. Re-run the setup script to fix it.
Usually the server's IP changed. Give the server a static IP / DHCP reservation, or connect by computer name instead of IP.
We can configure the server, the network and every counter remotely. Join for the download and our team will help with the rollout.