[QODBC-Online] - Configuring Multi-User Terminal Server Connections and Running a Daily Optimizer Script
Problem Description:
When QODBC Online is deployed on a Windows terminal server (or any multi-user environment), multiple simultaneous users may experience "Unable to bind port 8383" errors. This occurs because each QRemote Client and the QRemote Server must agree on the same port number, and all clients connecting through a shared server must be configured correctly.
Affected products: QODBC Online, QRemote Server for QODBC Online, QuickBooks Online Expected outcome: After configuring matching ports across QRemote Server and each client, and optionally scheduling a daily sp_optimizefullsync script, all terminal server users can connect to their respective company files simultaneously without port conflicts or optimizer drift.
Symptoms:
- An "Unable to bind port [port number]" error message appears intermittently when multiple users query QuickBooks Online data through QODBC on a terminal server.
- Some queries return incomplete results - certain transactions are missing, even though they exist in QuickBooks Online. Re-running
sp_optimizefullsync temporarily restores completeness but the issue recurs.
- The port conflict resolves itself after changing a different port number, but returns when another user connects on the default port 8383.
Cause:
Port binding: The QRemote Server listens on a specific port (default 8383). Each QRemote Client must be configured to connect to that same port. If multiple clients attempt to bind to the same local port without proper IP configuration, or if another application already uses that port, the "Unable to bind" error occurs.
Optimizer drift: QODBC Online maintains a local optimizer cache to speed up queries. Over time - especially under heavy concurrent use - records updated in QuickBooks Online may not appear in QODBC query results until the optimizer cache is refreshed. Running sp_optimizefullsync manually works but must be repeated for every company DSN.
Note
QuickBooks Online authentication tokens last 180 days. A reminder is sent at 150 days. After re-authorization, the token refreshes for another 180-day cycle.
Environment:
| Component | Detail |
| QODBC Online |
All versions (via QRemote) |
| QuickBooks Online |
All editions |
| Host environment |
Windows terminal server / multi-user RDP deployment |
| QRemote Server |
One per QuickBooks Online company (or shared across companies on same machine) |
Solution:
Part 1 - Configure QRemote Ports for Multi-User Access
- Open QRemote Server settings: Start → All Programs → QODBC Driver for QuickBooks Online → QRemote Server for QODBC Online → File → Settings → Advanced Tab.
- Select IP Address Configuration & Port Configuration and note the port number (default is 8383). Record this number.
- Open QRemote Client: Start → All Programs → QODBC Driver for QuickBooks Online → Configure 32-Bit QODBC Online Driver → System DSN → QuickBooks Online Data QRemote → Configure → Port tab.
- Enter the same port number recorded from the QRemote Server settings. Ensure it matches exactly.
- If multiple clients connect to the same server: each QRemote Client can use the same port number pointing to the server's IP address. Do not assign different local ports unless a specific conflict requires it.
- Test all terminal server user connections. Each user should connect without the "Unable to bind" error.
Part 2 - Create a Daily Optimizer Script (Optional but Recommended)
To automate sp_optimizefullsync for a specific table across all company DSNs, create a batch file:
- Create a PowerShell script file (e.g.,
OptimizeCompany-ps.ps1) that executes the following command against your DSN:
sp_optimizefullsync JournalEntry
This optimizes the JournalEntry table, which automatically includes JournalEntryLine.
- Create a batch file (e.g.,
Run Optimizer.bat) that runs the script for each company:
Run optimizer for Company A
powershell -ExecutionPolicy Bypass -File ".\OptimizeCompanyA-ps.ps1"
Run optimizer for Company B
powershell -ExecutionPolicy Bypass -File ".\OptimizeCompanyB-ps.ps1"
- Schedule the batch file to run daily via Windows Task Scheduler.
- To add a company DSN: copy an existing
OptimizeCompany-ps.ps1, rename it, and change only the DSN name inside the file.
SQL Examples:
The following commands are used in the solution above:
sp_optimizefullsync JournalEntry
Additional Notes:
- Token lifetime: The QuickBooks Online access token provided during authorization lasts 180 days. A reminder email is sent at day 150. After re-authorization, the cycle resets for another 180 days.
- One DSN per company: Create a separate DSN and authorize it for each QuickBooks Online company file. Each DSN has its own independent token lifecycle.
- Port selection: If the default port 8383 is already in use by another application, choose any available port number (above 1024). Use that same port consistently across QRemote Server and all clients.
- Optimizer caveat: Disabling the optimizer entirely eliminates missing-record issues but causes queries to run significantly slower. The daily automated approach above preserves performance while keeping data current.
Related Articles:
Troubleshooting - QB Begin Session Failed. Unable to Load Component Troubleshooting - Getting Error Unable to Bind to Specified IP Address How to Execute sp_optimizeupdatesync or sp_optimizefullsync for Selected Tables
Keywords:
QODBC Online QRemote Server QRemote Client Port Binding Terminal Server Multi-User RDP sp_optimizefullsync Optimizer Batch Script Windows Task Scheduler Port Configuration QuickBooks Online Token 180-Day Authorization Multiple Companies
Support Tickets: BHG-657-45815, MTK-636-99624
|