1. Darren Longenecker
  2. PowerBuilder
  3. Monday, 27 November 2023 23:14 PM UTC

2019 R2 build 2353

connected to SQL Server 17

 

I have to find a new way to pull out the contents of a text column (not rich text)  into a window control for displaying/editing by the user, then update changes back to the text column. 

The datawindow only allows for char(32766); I need it to be much more than that. I tried exporting the datawindow, manually changing the limit, importing it back. So now it shows as char(1024000) yet it still only brings back 32766. 

I found and tried this blurb from a help file:

Maximum text length
By default, the maximum text length for a DataWindow column is 32 KB. However, for most database drivers,
you can set this length to a higher value. For the PowerBuilder ODBC driver, you can set the maximum text
length in the pbodbxxx.ini file, where xxx is the PowerBuilder version number. If you add "PBMaxTextSize=1024000"
to the section of the INI file for the database to which you are connecting, you change the maximum text length
for a DataWindow column to 1 MB.

I found every instance of pbodb19.ini on my pc and changed the PBMaxTextSize to 1024000. So the MSSQL section looks like this:

[Microsoft SQL Server]
PBCatalogOwner='dbo'
PBSystemOwner='sys'
PBSyntax='MS_SQLSERVER_SYNTAX'
PBDateTime='MSSQLSERVER_DATETIME'
PBFunctions='MSSQL_FUNCTIONS'
PBSpecialDataTypes='SYBASE_SPECIALDATATYPES'
PBObjectIDs='YES'
PBMaxBlobSize='32767'
;PBMaxTextSize='32767'
PBMaxTextSize='1024000'
PBDWDynamic='NO'
PBPrimaryKeyName='YES'
Block=1
SQLSrvrTSPrefix='0x'
PBUseProcOwner='YES'
PBDefaultValues='USER,SYSTEM_USER,USER_ID(),HOST_ID(),HOST_NAME(),DB_ID(),DB_NAME(),CURRENT_TIMESTAMP,NULL'
PBDefaultCreate='YES'
PBDefaultAlter='NO'
PBDefaultExpressions='YES'

 

Yet the datawindow column still restricts to char(32766).

I thought it might be because of the "DB Profiles" connection as I am working in dev environment. I exported the profile, added "DBTEXTLIMIT=1024000' to the connection string and imported the profile back into PB:

// Profile mydbprofile
SQLCA.DBMS = "OLE DB"
SQLCA.LogPass = <***********>
SQLCA.LogId = "xx"
SQLCA.AutoCommit = False
SQLCA.DBParm = "PROVIDER='MSOLEDBSQL',DATASOURCE='myserver',PROVIDERSTRING='database=mydatabase',dbtextlimit='1024000'"

 

Opened the datawindow w/ the revised connection and column in datawindow was still limited to 32766. When I look at the source (SQL), add a random space and click back to the datawindow, the column resets itself from char(1024000) to char(32766).

 

 

 

Darren Longenecker Accepted Answer Pending Moderation
  1. Wednesday, 29 November 2023 16:33 PM UTC
  2. PowerBuilder
  3. # 1

You're a saint, Chris. Thx!

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 29 November 2023 16:40 PM UTC
Hi Darren .. you are most welcome. :-)

Hmmm "Sainthood" - a new PB Master level? - LOL!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 28 November 2023 00:15 AM UTC
  2. PowerBuilder
  3. # 2

Hi Darren;

  • PB 2019 R2 release is now deprecated.
  • The PBMaxTextSize setting is not supported by OLEDB driver.
  • The PBMaxTextSize parameter in the PB.INI file is only when using an ODBC connection.
  • The PBMaxTextSize setting should be used in the DBParm field of SQLCA, as follows:

https://docs.appeon.com/pb2022/connection_reference/PBMaxTextSize.html

HTH

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.