To obtain NRV using BDE and ADA, you set up a local Borland Database Engine alias pointing at your data files, then open that alias with an ADA (Ada programming language) database binding and run a query or table read against the NRV dataset. "NRV" is not a standard BDE or ADA object, so the key condition is knowing exactly what NRV means in your system—a table name, a stored procedure, a computed value, or a vendor-specific acronym. The steps below assume NRV is a table or query you can reach through a BDE alias; the article also covers what to change if it is a computed field and what to do when the alias opens but NRV is missing.
BDE and ADA are both dated technologies. The Borland Database Engine (BDE) is a Windows database middleware layer that shipped with Delphi, C++Builder, and Paradox, and it reached end-of-life in the early 2000s. "ADA" here means the Ada programming language, not a database product, so obtaining NRV means writing an Ada program that talks to BDE rather than using a native Ada database library. That combination is unusual, which is why the practical path usually runs through BDE's ODBC driver and an Ada binding to ODBC, or through a small Delphi/C++Builder helper that exposes NRV to an Ada main program. Everything below is written for the November 2026 reference date, meaning BDE is legacy software you run on purpose in a controlled Windows environment, not something you install fresh for new development.
What BDE and ADA Actually Give You
BDE is a client-side engine: it manages aliases (named connection definitions), drivers for Paradox, dBASE, FoxPro, Access, and SQL databases, and a shared-memory layer that caches connections and metadata. An alias stores a driver type, a database path or server, and language settings. Your Ada code cannot call BDE's native API directly without a C or Pascal interface, because BDE's public surface is a C API (the IDAPI functions such as DbiOpenTable and DbiGetRecord) plus the Delphi VCL components that wrap it.
Ada has no standard, maintained BDE binding. What does exist is a general capability to import foreign functions or to speak a wire/ODBC protocol. That leaves three workable architectures:
1: Ada program → ODBC → BDE ODBC driver → alias → NRV. 2: Ada program → small C shim over the BDE IDAPI C API → NRV. 3: Ada program → helper executable written in Delphi or C++Builder that queries NRV and returns results over a pipe, file, or socket.
Each has trade-offs in setup effort, portability, and failure visibility. The ODBC route is the least code but depends on the BDE ODBC driver being installed and configured. The C shim route gives direct access to BDE features like table-level locking and Paradox keyed access, but you maintain the interface. The helper route keeps BDE in the environment where it is best supported and lets Ada stay clean.
Prerequisites Before You Touch Code
Get these in place first. Skipping any one of them is the most common reason NRV "doesn't appear."
A Windows machine where BDE is installed and licensed for your use. On 64-bit Windows, BDE is a 32-bit engine, so your Ada program, ODBC layer, or helper must also be 32-bit. A 64-bit Ada executable cannot load 32-bit BDE DLLs. The BDE Administrator tool (part of the BDE install) available so you can create and test an alias. The NRV data in a location BDE can reach: a local folder for Paradox/dBASE/FoxPro tables, a server for SQL links, or an ODBC data source for a database BDE does not natively drive. An Ada toolchain that can produce 32-bit Windows binaries and either bind to ODBC (through a package such as an ODBC binding or your own thin interface) or expose a C interface for a shim. Credentials and network access if NRV lives on a database server. A way to verify NRV independently: a working BDE-based tool such as Database Desktop, or a DSN test in the Windows ODBC Data Source Administrator.
Confirm the BDE version and the bitness of the installed engine before writing code. If BDE Administrator cannot open your NRV alias, no amount of Ada will fix it.
Step 1: Define and Test the BDE Alias
1: Open BDE Administrator. On the Databases tab, right-click and choose New. 2: Pick the driver that matches NRV's storage. Use STANDARD for Paradox, dBASE, or FoxPro files; use the specific SQL link driver if you have one; use an ODBC driver entry if NRV is behind ODBC. 3: Name the alias something explicit, for example NRV_PROD or NRV_TEST, and set the PATH (for file-based data) or SERVER NAME, USER NAME, and related parameters for SQL. 4: Apply the change. BDE may prompt to save; accept. 5: Test connectivity before leaving the tool. For file-based aliases, open the alias and confirm the NRV table is listed. For SQL aliases, use the alias's open/test function and provide credentials.
Success check: the alias opens and NRV is visible as a table or view. Failure check: if the alias opens but NRV is absent, you are probably pointed at the wrong directory, the table has a different name, or the logged-in user lacks privileges. Fix that in BDE Administrator or on the server before proceeding—this is a data-access problem, not a code problem.
Record the exact alias name and the exact NRV object name, including case and any schema prefix. Ada code and ODBC connection strings are unforgiving about both.
Step 2: Choose the Ada-to-BDE Path
Use the criteria below to pick one path and commit to it.
| Path | Setup effort | Direct BDE features | Typical failure mode | Best when |
|---|---|---|---|---|
| Ada → ODBC → BDE ODBC driver | Low to medium | Limited to SQL and ODBC-exposed behavior | DSN or driver bitness mismatch | NRV is reachable by SQL and you want minimal code |
| Ada → C shim → IDAPI | Medium to high | Full table, key, and lock control | Struct layout and calling-convention errors | You need Paradox-native access or BDE cursors |
| Ada → Delphi/C++Builder helper | Medium | Full, in the native host | Interprocess plumbing and error mapping | You want BDE handled by its best-supported compiler |
If NRV is a computed value rather than a stored table—say a "net realizable value" calculated from inventory or receivables fields—none of these paths return it directly. You must either call the stored procedure or view that computes it, or replicate the formula in Ada after reading the underlying columns. Clarify which before choosing, because the ODBC path can call a view or procedure while the file-based path cannot.
Step 3: Wire Up the ODBC Route
This is the most reproducible path when NRV is SQL-accessible.
1: In Windows ODBC Data Source Administrator (32-bit), create a System DSN that uses the BDE ODBC driver and points at your NRV alias. Some BDE installations expose this as a driver named for the BDE; others require you to configure the BDE alias first and then reference it. Follow whatever the installed driver's setup dialog asks for and test the DSN from the same dialog. 2: In Ada, bind to ODBC. You need functions for environment allocation, connection, statement execution, and fetching. A thin binding over SQLAllocHandle, SQLConnect or SQLDriverConnect, SQLExecDirect, SQLFetch, and SQLGetData is enough for a read-only NRV pull. 3: Build the connection string. Use the DSN name plus any credentials. If the DSN already carries the alias, you do not repeat the path. 4: Execute a bounded query. Start with something like SELECT * FROM NRV, or better, a projected and filtered query that returns a small number of rows. BDE and old ODBC drivers can be slow or memory-hungry on wide result sets. 5: Fetch into typed Ada variables. Match column types deliberately: numeric columns into appropriate fixed or floating types, text into bounded strings. Watch for nulls and for BDE's tendency to pad character fields. 6: Close the statement, disconnect, and free handles in reverse order. Leaking ODBC handles in a long-running Ada program will eventually exhaust the driver.
Success check: your Ada program prints a known row from NRV that you independently verified in BDE Administrator or a DSN test. Failure check: a connection error usually means DSN bitness or credentials; a "table not found" means the alias or object name is wrong; a type error means your fetch buffer does not match the column.
Step 4: Wire Up the C Shim Route
Use this when you need BDE-native behavior or when ODBC is unavailable.
1: Write a small C library that includes BDE's IDAPI headers and calls DbiOpenTable or the appropriate open function against your alias, then DbiGetRecord or field-level reads. Keep the shim narrow: one function to open NRV, one to read the next row into a caller-provided struct, one to close. 2: Compile it as 32-bit and link against the BDE import libraries that match your installed BDE. 3: Import the shim's functions into Ada with the correct convention (typically C) and matching struct layouts. This is where most defects appear: field order, padding, and string representation must line up exactly. Define the Ada record to mirror the C struct and verify sizes with a static assertion or a runtime size check. 4: Call open, loop reads until end-of-table, copy fields into Ada types, then close. 5: Handle BDE status codes explicitly. BDE returns a status value from each call; treat anything other than success as a branch point, and translate codes into Ada exceptions or error returns rather than ignoring them.
Success check: the Ada program reads the same row count and a sample row as BDE Administrator. Failure check: crashes or garbage fields usually indicate struct mismatch or a calling-convention error; "alias not found" means the alias name or BDE configuration path is wrong for the process's environment.
Step 5: Wire Up the Helper Route
When BDE's native compiler support is the path of least resistance:
1: Write a small Delphi or C++Builder console program that opens the NRV alias through the BDE components, runs the query, and writes results as delimited text, JSON, or a simple binary format to standard output or a temp file. 2: Have the Ada program launch the helper with the alias and query parameters, read the output, and parse it. 3: Define the contract tightly: exit codes for success, empty result, and error; a stable field order; explicit null markers. 4: Keep the helper stateless and idempotent so retries are safe.
Success check: running the helper alone reproduces the NRV data. Failure check: if the helper works but Ada sees nothing, the problem is in process launching, working directory, or output parsing.
Handling NRV as a Computed Value
If NRV is net realizable value, the "obtain" step often means calculate, not fetch. The common formula is NRV equals estimated selling price minus costs to complete and costs to sell. In a data system, that usually appears as:
A view or stored procedure that computes NRV from price, completion-cost, and selling-cost columns. A set of raw columns you must combine yourself.
If the first, call the view or procedure by name and treat its output as NRV. If the second, read the component columns and compute in Ada with a documented formula, explicit rounding rules, and a record of which inputs were null. Never silently treat a null cost as zero; that inflates NRV and is the most common reporting error in this kind of calculation. Show your rounding (for example, round half up to two decimals) and keep intermediate precision higher than final output.
Worked example, clearly illustrative: if estimated selling price is 120.00, costs to complete are 15.00, and costs to sell are 8.00, NRV is 120.00 - 15.00 - 8.00 = 97.00. If two of ten rows have a null selling cost, decide and document whether those rows are excluded or flagged, because the total changes materially.
Troubleshooting by Symptom
Match the symptom to the likely cause and start with reversible checks.
Alias opens in BDE Administrator but not in Ada. BDE resolves aliases from a configuration file whose location can depend on the process environment. Check that your Ada process runs with the same BDE configuration visibility as the tool, and that it is 32-bit. "Table not found" for NRV. Verify the exact object name and schema, confirm the login has SELECT, and check whether the alias points at a different directory or database than you assumed. Connection succeeds, fetch returns wrong types. Recheck column types and buffer sizes; old drivers may return text for numeric fields. Intermittent failures under load. BDE caches and locks; concurrent writers or too many open cursors can cause contention. Reduce result-set size, close cursors promptly, and serialize access where needed. Program crashes on first BDE call. Almost always bitness or DLL search path. Confirm 32-bit binary and that the BDE DLLs are findable by the process.
Stop and bring in the database or BDE administrator when the failure is on the server side (permissions, corruption, locking by other users) or when you cannot establish a stable alias. Continuing to change Ada code against an unstable data layer wastes time and can mask the real fault.
Limits, Versions, and What to Verify
BDE is legacy and unsupported for new development, so treat every version detail as environment-specific. The BDE version and the ODBC driver version must match what is actually installed on your November 2026 machine; I cannot verify current availability or licensing for you. Ada compiler versions differ in how they expose C imports and ODBC bindings, so confirm the convention and package set your toolchain documents. If NRV sits on a modern database, prefer a native Ada database driver or a modern connector over BDE entirely, and use BDE only where an existing system requires it.
The honest summary: BDE gives you the alias and data access, Ada gives you the program, and the bridge—ODBC, a C shim, or a helper—is where the work and the risk live. Pin down what NRV is, prove the alias works without Ada, then build the thinnest possible bridge and test it against a known row.