# AltDB: An Open-Source Drop-in Replacement for AsDB (AS 6 Compatible)

**URL:** <https://community.br-automation.com/t/altdb-an-open-source-drop-in-replacement-for-asdb-as-6-compatible/13091>\
**Category:** Code & Libraries\
**Tags:** library, open-source, automation-studio-6\
**Created:** [October 26, 2026, 2:43pm UTC](https://community.br-automation.com/t/altdb-an-open-source-drop-in-replacement-for-asdb-as-6-compatible/13091 "2026-10-26T14:43:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beani](https://avatars.discourse-cdn.com/v4/letter/b/FF8800/32.png) [@beani](https://community.br-automation.com/u/beani)\
**Post date:** [October 26, 2026, 2:43pm UTC](https://community.br-automation.com/t/altdb-an-open-source-drop-in-replacement-for-asdb-as-6-compatible/13091/1 "2026-10-26T14:43:55Z")

</div>

Hello B&R Community,

With the discontinuation of the `AsDB` library in Automation Studio 6, projects relying on native SQL Server connectivity face migration challenges.

To help address this gap, I have published **AltDB** , an open-source, clean-room drop-in replacement library designed to restore MS SQL Server connectivity in Automation Studio 6 without requiring changes to existing application code.

### Overview

AltDB is written directly against the published Microsoft Tabular Data Stream (`[MS-TDS]`) wire specification, with no FreeTDS or LGPL licensing restrictions. It preserves the exact function block interfaces, error numbers, and asynchronous state-machine behavior (`ERR_FUB_BUSY`) of legacy AsDb:

- `dbConnect()` / `dbConnectEnc()`
- `dbExecuteSql()`
- `dbFetchNextRow()`
- `dbGetData()`
- `dbGetAffectedRows()`
- `dbGetColumnCount()`
- `dbGetErrorMessage()`
- `dbDisconnect()`
- `dbGetInfo()`

### Using AltDB in an Existing Project

Replacing `AsDB` in an existing machine application takes just a few steps:

1. Download and unzip `AltDB.zip` from the latest GitHub release.
2. In Automation Studio, delete the legacy `AsDb` library from your Logical View if it has not already been removed by the AS 6 project upgrade.
3. Click the **Libraries** button on the Automation Studio toolbar and select **Existing library…**.
4. Navigate to and select the extracted `AltDB` folder to import it into your project.
5. Rebuild your project. Existing task code, function block calls, and cyclic state machines remain unchanged.

### Testing with ARsim and Docker

The repository includes a complete Automation Studio sample project along with a preconfigured `docker-compose.yml` to make local testing straightforward:

1. Clone the repository and run:

2. Open the included sample project in Automation Studio.

3. Build and transfer the project to **ARsim**.

4. Open the Watch window for the included recipe task and trigger `eCMD_CONNECT` to test connections, table creation, record insertion, and queries.

### Current Testing Status & Disclaimer

AltDB has currently been minimally validated. Feedback, bug reports, and ways in which behavior differs from AsDB are welcome.

**GitHub Repository:** [br-automation-community/AltDB: An alternative database connection library for B&R targets](https://github.com/br-automation-community/AltDB)

**Latest Releases:** [Releases · br-automation-community/AltDB](https://github.com/br-automation-community/AltDB/releases)

I hope this helps anyone transitioning legacy AsDb codebases to Automation Studio 6.
