Video guide · 2:51

Connect a Handheld App to SQL Server or PostgreSQL

Add one database connection on the server, test it, and pull rows into a lookup table with a SELECT query, so every handheld carries the data and scans work with no signal.

What you will learn

  • Choose SQL Server, PostgreSQL or ODBC and fill in the boxes
  • Read the connection string and press Test connection
  • Write a SELECT query and let StepVane build the columns
  • Set how often the server checks the database

Transcript

In this guide you will connect StepVane to a SQL Server or PostgreSQL database, and pull data from it into a lookup table that every handheld carries. We will use PostgreSQL, and SQL Server works the same way.

Start in an app. Press New app, name it Warehouse Items, and choose a blank app. Database connections belong to the server, so any app on this server can use the one we make.

Open Data, then Connections, and press Add connection. Choose Database. A database connection is stored on the server, the password is kept encrypted, and it is never shown again.

Give the connection a name, such as Warehouse underscore DB. Then choose the database type: SQL Server, PostgreSQL, or ODBC for anything else, such as MySQL or Oracle. We choose PostgreSQL.

Fill in the boxes: the server name or address, the port, the database name, and a user name and password. Use a user that can only read the tables you need. Encryption can stay off on your own network.

Under the boxes, StepVane shows the connection string it will use, with the password hidden. Press Test connection. The server connects, and answers in plain words: here the database answered, so the settings work. Then press Save connection.

Now pull data. Open Lookup tables, add one, and name it Items. For Rows come from, choose A SQL query, and pick the connection we just saved.

Type the query. It must be a SELECT. Here we read the item, description, unit, quantity on hand, and bin from the items table. When you leave the box, StepVane runs the query, and builds one column for each column it returns. Nothing else to type.

The columns are named after the query. You can rename what the app shows, and the first column becomes the Key, the column that scans are matched against. Press Test query to see how many rows were read, and the first rows, straight from your database.

The server re-runs the query in the background, as often as the Check the database every setting says, and phones get the new rows at their next sync. So when your stock changes in the database, the handhelds follow. If the server cannot reach the database, phones keep working from their last copy.

That is how you pull data from a database. Add one connection on the server, write one query, and every handheld gets the rows, ready to scan against, even with no signal. The same steps work for SQL Server.

Related

More guides

Start with one device today

Free for Studio, one handheld and one worker. No cloud account, no credit card.