I am using the CASE statements for setting database connection details up to PB2021 without PowerServer
Example:
Case IS_USE_SCRIPT /* Populate Database Connection from Script */
as_dbms = "ODBC"
as_database = ""
as_userid = ""
as_dbpass = ""
as_logid = ""
as_logpass = ""
as_server = ""
as_dbparm = "ConnectString='DSN=ABCD;UID=xyz;PWD=12345Etc'"
as_lock = ""
as_autocommit = "false"
This works perfectly fine until I try running PowerServer Object.
When I run the powerserver object I get the following error:
---------------------------
Cannot Connect to Database, Application will now close
---------------------------
The database type cannot be confirmed because the driver information of DBMS 'ODBC' is not specified in DBParm
---------------------------
OK
---------------------------
Any pointers would be appreciated.
Environment is:
PB 2021, Sybase SQL Anywhere 17
//so my solution works and connects I just used the following:
if isPowerClientApp() or isPowerClientApp() then
m_pb_environment = false
m_web_environment = true
else
m_pb_environment = true
m_web_environment = false
end if
if m_web_environment then
as_dbms = "SNC SQL Native Client(OLE DB)"
as_server = "localhost"
as_autocommit = "true"
as_dbparm = "Database='db_server_name',DelimitIdentifier=1,cachename='XXXXX_Cache',cachegroup='default'"
return 1
else
...left old processing for client server application
end if
//other refactoring continues...
https://docs.appeon.com/pb2022/powerscript_reference/IsPowerServerApp_func.html