I am upgrading my application from PowerBuilder v7 to PowerBuilder 2017. The PBLs are in the new version and the application compiles/deploys successfully. I should mention that I get a message at the end of the compiling that says "Invalid Executable File Name", but it creates a new executable and new PBDs. Besides that message it seems OK.
My problem now is the runtime doesn't connect to the database. When I run the application it does not connect to the database.
The database is a Microsoft SQL Server database. I have version 2016 here. My clients all use version 2008R2.
The application code is as follows:
pt_sqlca.dbparm = "PROVIDER='SQLNCLI11SQL',DATASOURCE='" + pt_sqlca.Servername + "',PROVIDERSTRING='DATABASE="+pt_sqlca.Database+"'"
connect using pt_sqlca;
The actual content of pt_sqlca.dbparm is:
PROVIDER='SQLNCLI11SQL',DATASOURCE='aka1001',PROVIDERSTRING='DATABASE=popss'
I tried changing the Provider to SQLNCLI and SQLNCLI11. It did not work with either one.
In PBv7 it says PROVIDER='SQLOLEDB'. I tried SQLOLEDB in PowerBuilder 2017 also, but that also didn't connect.
The other parameters are:
pt_sqlca.LogID = "aka"
pt_sqlca.LogPass = "aka"
pt_sqlca.UserID = "aka"
pt_sqlca.DBPass = "aka"
pt_sqlca.Database = "popss"
pt_sqlca.Servername = "aka1001"
pt_sqlca.Dbms = "SQLNCLI11SQL"
pt_sqlca.lock = "RU"
After the attempted connect, the return code, pt_sqlca.sqlcode = -1
What am I doing wrong? What do I have to do to connect?
--------------------------------------------------------------------------------------------
The application connects to the database from inside PowerBuilder. The DB Profile Preview is:
SQLCA.DBMS = "SNC SQL Native Client(OLE DB)"
SQLCA.LogPass = <***>
SQLCA.ServerName = "aka1001"
SQLCA.LogId = "aka"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Database='popss',Provider='SQLNCLI11SQL'"
If you need other information from me, let me know and I will send it.
The first 3 characters of sqlca.DBMS correspond to positions 3-5 of the interface dll. In your case, PBSNC170.DLL.
Sounds like the SQL Server client is not installed on the PC maybe? All that PBSNC170.dll(SS Interface driver in PB) does is call the actual SS client driver. If it cannot find the SS Client - that is the type of error you would get.
Regards ... Chris
This is what I did. For one, and I don't know if this matters, I changed the DB Profile. I deleted the Interface from SNC SQL Native Client and set it up using OLE Microsoft OLE DB. By the way, it connects with either profile from the connect button in the DB Profile.
Then I changed the pt_sql.Dbms parameter to OLE DB. And I changed the connect string to the following:
pt_sqlca.dbparm = "PROVIDER='SQLOLEDB',DATASOURCE='" + pt_sqlca.Servername + "',PROVIDERSTRING='DATABASE="+pt_sqlca.Database+"'"
The change is the provider is SQLOLEDB instead of SNC or SQLNCLI11, or the other variations of SQLNCLI I had been trying without success.
Now it is connecting.
I don't understand the problem I was having with SNC SQL Native Client but for now I am just happy it is working with OLE DB.
Thanks for your previous help and the time you spent on it.
Jon Stoller - AKA Software Services