Repository navigation
v1.2.0
Tables drawn on a sheet are served as tables of their own, and a connection
counts its transactions.
pip install --upgrade pysqlbridge
{
"tables": [
{ "excel": "data/budget.xlsx" },
{ "excel": "data/budget.xlsx", "table": "Headcount" },
{ "excel": "data/budget.xlsx", "sheet": ["Q1", "Q2"] }
]
}A table on a sheet is a table. What Excel calls a table, and the object
model a ListObject, is a range somebody drew and named, kept in a part of its
own with its range, its name and its column names. A workbook now serves one
table per sheet and one per table on a sheet, each named after itself. A
table under a title is served where the sheet used to be refused, and two
tables on one tab are two tables: they used to arrive as one, with the second
one's headings as a record and its numbers dragged over to text. "sheet"
and "table" narrow a workbook to what they name, one name or a list, and
"table" takes a list beside an Access database too.
A tab is left out where the file says its own reading would be wrong. It
carries more than one table, a table of its own name, a table ending in a
totals row that would arrive as a record called Total, or a table with no
header row. The log says which, and naming the tab serves it anyway.
One unreadable tab no longer refuses a workbook. A tab that cannot be
read as one table, for a stray value past its headings or a heading that
cannot be a column name, is left out with the reason in the log, and the rest
of the workbook is served. Name it and the reason comes back as an error. A
cell that cannot be read at all still refuses the file.
Checked against Excel itself. Five workbooks Excel saved for other
projects, and a probe that has Excel write every layout, found three of these
before release. The probe is scripts/workbook_probe.py and drives Excel
over COM; nothing in the package does.
@@TRANCOUNT counts. It answered nought whatever a batch did. BEGIN TRAN,
COMMIT, ROLLBACK and SAVE TRAN now move it per connection, as measured on SQL
Server 2025: savepoints roll back as a stack, only the outermost transaction
is known by name, and each refusal carries SQL Server's number and words.
Nothing is written, so there is still nothing to commit or roll back.
Three older bugs fixed with it. An IF saw every @@ variable as null, so
IF @@ROWCOUNT = 0 never held. IF @@TRANCOUNT > 0 COMMIT TRAN was refused
outright. And BEGIN TRAN, a SELECT and COMMIT written a line apiece lost the
SELECT, with nothing to say so.
983 of 984 queries in the differential answer as SQL Server 2025 does, with
the same column types and the same message numbers.
.NET's SqlConnection.BeginTransaction() is not supported: it sends a
transaction manager request, and the bridge closes the connection. A
transaction begun in T-SQL works.