- Jostein Ullestad
- PowerBuilder
- Friday, 10 March 2023 01:16 PM UTC
Hi
We are looking for ways to connect PowerBuilder 2021.1506 application to an Azure database.
We can connect to the database using:
SQLCA.DBMS = "MSOLEDBSQL SQL Server"
SQLCA.ServerName = "tcp:<our server>.database.windows.net,<port>"
SQLCA.Database = "<our database>"
SQLCA.LogId = "UserA"
SQLCA.LogPass = "my_password"
Which is similar to the C# sample for Microsoft, https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-dotnet-visual-studio?view=azuresql
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = "<our server>.database.windows.net";
builder.UserID = "UserA";
builder.Password = "my_password";
builder.InitialCatalog = "<our database>";
//builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryPassword;
Both cases are working just fine.
What we would like is to have the following C# code/connection working from PB as well:
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = "<our server>.database.windows.net";
builder.UserID = "noone@nowhere.no";
builder.InitialCatalog = "<our database>";
builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryInteractive;
This is working from C#, but I am unable to get such working from PB
SQLCA.DBMS = "MSOLEDBSQL SQL Server"
SQLCA.ServerName = "tcp:<our server>.database.windows.net,<port>"
SQLCA.Database = "<our database>"
SQLCA.LogId = "noone@nowhere.no"
SQLCA.dbparm = "Authentication=ActiveDirectoryInteractive"
(noone@nowhere.no - Is fiction and for sample purposes only)
I get
---------------------------
Connect
---------------------------
SQLSTATE = HY000
Microsoft OLE DB Driver for SQL Server
Cannot open server "nowhere.no" requested by the login. The login failed.
SQLDBCode 40532
---------------------------
OK
---------------------------
Will this be achievable from PowerBuilder, if so how?
Thank you
Jostein
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.