1. Yasir Masood
  2. PowerBuilder
  3. Tuesday, 11 February 2020 22:46 PM UTC

Hi guys.

We are trying to connect to an Azure DB using PB 2017, but get the following error

SQLSTATE = HY000
Microsoft SQL Server Native Client 10.0
Server name cannot be determined.  It must appear as the first segment of the server's dns name (servername.database.windows.net).
 Some libraries do not send the server name, in which case the server name must be included as part of the user name (username@servername).
 In addition, if both formats are used, the server names must match.

Here is my INI file


[database]
DBMS = "SQLNCLI10"

DBParm="PROVIDER='SQLNCLI10',DATASOURCE='aztrmsql1t-.database.windows.net',PROVIDERSTRING='database=TEST',PBTrimCharColumns='YES',INTEGRATEDSECURITY='SSPI',OJSyntax='PB'"
LogId=sa
LogPassword=
ServerName=aztrmsql1t-sc.334f2f6a6f98.database.windows.net
Database=TEST
PlantId=
UseNTAuth=Y
SQLServVer=8
Hosted=Y
UserId=sysadm
DatabasePassword=SYSADM
;Lock=RL
Lock=RC
Columns=8
StayConnected=1
TableSpace=
DBEFileSetName=
TableDir=1
AutoCommit=0

Can someone please help.

Thanks

 

 

Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 12 February 2020 00:21 AM UTC
  2. PowerBuilder
  3. # 1

What are the contents of the following SQLCA properties when CONNECT fails?

You can ignore any property = empty string.
You can overwrite sensitive texts (like UserIDs) with Xxxx and sensitive numbers (like IP addresses) with 000.

SQLCA.AutoCommit = ...
SQLCA.Database = ...
SQLCA.DBMS = ...
SQLCA.DBParm = ...
SQLCA.DBPass = ...
SQLCA.Lock = ...
SQLCA.LogId = ...
SQLCA.LogPass = ...
SQLCA.ServerName = ...
SQLCA.UserId = ...

Required properties  and specific DBParms all depend on what driver (SQLCA.DBMS) your app has set when CONNECT executes. The easiest way for myself to find such values is 1) start debugger; 2) breakpoint at the CONNECT statement; 3) Run app; and jot down what I see when inspecting SQLCA.

Comment
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Wednesday, 12 February 2020 14:25 PM UTC
  2. PowerBuilder
  3. # 2

DBParm is missing "sc.334f2f6a6f98" after the "-" in the server name, so the two diff names don't match.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 12 February 2020 17:44 PM UTC
  2. PowerBuilder
  3. # 3
Comment
  1. Michael Kramer
  2. Wednesday, 12 February 2020 17:56 PM UTC
The community link in Chris' reply contains successful SQLCA setup!
  1. Helpful
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.