cancel
Showing results for 
Search instead for 
Did you mean: 

powerbuilder connection

Former Member
0 Kudos

i am using PB11.5 build 3050

my question is about datasources for connecting to a database. I have been told if I put all my information in the connectstring that I don't need to define a datasource. It seems with powerbuilder I need my datasource.

Currently this is what I have to connect:

I have a datasource set up named MAXTEST

[Profile MAXTEST]

DBMS=ODBC

Database=MAXTEST

UserId=

DatabasePassword=

LogId=

LogPassword=

ServerName=

DBParm=ConnectString='DSN=MAXTEST;UID=user;PWD=pwd'

Lock=

Prompt=FALSE

AutoCommit=FALSE

I have tried this using this:

*NO datasource named MAXTEST_CAROL

[Profile MAXTEST_CAROL]

DBMS=

Database=

UserId=

DatabasePassword=

LogId=

LogPassword=

ServerName=

DBParm="ConnectString='ODBC;Driver={SQL Server};ServerName=CS-SQL-04;Database=MAXTEST;UID=user;PWD=pwd"

Lock=

Prompt=FALSE

AutoCommit=FALSE

when I use this i get a dialog box to choose my datasource.

Is it powerbuilder that requires the datasource or am I doing something incorrect?

hopefully this is enough information to help me or point me in the right direction.

Thanks.

CarolD

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Have a look at this thread:  http://scn.sap.com/thread/3382586

Former Member
0 Kudos

If you are referring to a DSN-less connection, for MS sqlserver the format would be

something like this:

SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DRIVER=SQL Server;UID=xxxx;PWD=xx;SERVER=<servername>;DATABASE=XXXX'"

connect using sqlca;

Former Member
0 Kudos

Thank you! That’s exactly what I’m talking about.

I have tried the connect string you provided. Now I’m not asked for the DSN but it can’t find my server.

Any ideas?

Former Member
0 Kudos

In your two original example above. You are not specifying the DBMS one example. If you specify ODBC and the connection fail you will indeed get a second chance dialogue box.

Anyway I just thought the answer was in that thread. 

I would have thought that you either use ODBC and refer to the DNS in the dbparm connect string

or use a different driver like OLE and provide the additional parameters in dbparm and logid/password.

(example from the mentioned thread)

SQLCA.DBMS="OLEDB"

SQLCA.LogId="sa"

SQLCA.LogPassword="sasa"

SQLCA.DBPARM="PROVIDER='SQLNCLI10',DATASOURCE='COMPUTERNAME',DelimitIdentifier='Yes',PROVIDERSTRING='database=MyDatabse'"

I also note that the examples appear like an ini file.  You are connecting from your development environment OK? If you are, go to the properties of the database profile and look at the Preview tab.  You can copy the entire syntax (minus password) from here and paste it in you PB script....