-
Kairos Jeong
- PowerBuilder
- Friday, 2 October 2026 09:50 PM UTC
Hi,
After moving our application from runtime 25.0.0.3726 to 25.1.0.6464, several customer sites report "SQLSTATE = 22007 Conversion failed when converting date and/or time from character string" on DataWindow updates.
Environment: PowerBuilder 2025 R2, runtime 25.1.0.6464, DBMS "SNC SQL Native Client(OLE DB)" with Provider='SQLNCLI11', SQL Server 2016 and later, DisableBind not set, so the SNC default of 1 applies.
The DataWindow column and the table column are both datetime.
The script sets the value with SetItem(row, "updatetime", Today()) or with a DateTime() value.
With binding disabled, the generated statement now contains a literal such as '2026-10-03 13:22:12.343000'.
A Date value set with Today() fails as well, because the literal becomes '2026-10-03 00:00:00.000000'.
SQL Server accepts at most 3 fractional digits when it converts a string to datetime, so the statement fails.
On SQL Server 2016, SELECT CONVERT(datetime, '2026-10-03 13:22:12.343000') fails with Msg 241, while the same value with 3 fractional digits converts.
The same code and the same DBParm work on runtime 25.0.0.3726, and adding DisableBind=0 makes the error disappear.
The application has several hundred DataWindows with datetime columns, so changing the code is not a practical option.
I can provide a database TRACE log of the generated UPDATE statement on request.
This looks like the SQL Server counterpart of the Datetime2 regression that Appeon confirmed in July 2026 for the Oracle driver in the thread "PB 2025 R2 Datetime2 support and Oracle Timestamp", where a pbora.dll hotfix was provided [1].
I believe the change comes from the datetime2 precision work tracked as Bug 11851 [2][3].
My questions:
1. Is this a known regression in the 25.1 SNC driver, and is a hotfix DLL available as it was for Oracle?
2. Is the DateTimeFormat DBParm, DateTimeFormat='\''yyyy-mm-dd hh:mm:ss.fff\''', the intended workaround for SNC with DisableBind=1?
3. Should the driver build the literal according to the column type, 3 digits for datetime and 7 digits for datetime2?
Thank you.
References:
[1] https://community.appeon.com/qna/q-a/pb-2025-r2-datetime2-support-and-oracle-timestamp
[2] https://community.appeon.com/index.php/qna/q-a/pb-support-for-datetime-and-datetime2-in-sql-server
[3] https://www.appeon.com/standardsupport/search/view?id=11851
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.