MS SQL 6.5 and PowerBuilder 6.5

I have an application in PB6.5 that interfaces with MSSQL 6.5 database.
I can run this app WITHIN PB to make a connection the database and
retrieve data without a problem, but after I built the EXE file and
trying to run from that EXE file, I get a "-1" as the return code from
the SetTransObject statement. Sample code is like :

datastore lds_datastore
lds_datastore = CREATE datastore
lds_datastore.DataObject = "d_test"
li_return = lds_datastore.SetTransObject(SQLCA)

The d_test datawindow object consists of a simple SQL SELECT statement.

Has anyone seen this problem before?? This is a VERY simple application,
I'm not using an "ini" file and all database parameters are hardcoded in
the OPEN event of the application object. I checked the connection after
the OPEN event, and it's OK, I even incorporated an embedded SQL
statement in a PB script and it executed it correctly. The strangest
thing is I can run it successfully in the PB development environment but
I can't after I built the EXE file!!! HELP!!!

Thanks in advance

Cassian Lee
cklee@mmm.com

-1
Cassian
8/25/1999 9:07:00 PM
sybase.powerbuilder.database 9855 articles. 1 followers. Follow

1 Replies
592 Views

Similar Articles

[PageSpeed] 47

Cassian --

If all you're building is an exe, and no pbd files, then the problem is that
the datawindow d_test is not being included in the executable.  Because of
this, it's not available at runtime, so setting the transaction object
returns -1.

There are two workarounds:
1) Generate pbds for all libraries in your app.  One benefit of this is that
the exe file will be extremely small, and quicker to load.  The downside (if
it really is one) is that you'll have more files to deploy.
2) Create a pbr file that contains a reference to the datawindow object.
Something like this:
d:\dev\mypbl.pbl(d_test)
Then, associate this pbr file with the executable when you build the app.
The referenced object(s) in the pbr file will be included in the exe that's
generated.

HTH

Ron Gallagher, CPDP
Atlanta, GA
rongallagher@mindspring.com

Cassian Lee wrote in message <37C45AF3.61DA2523@mmm.com>...
>I have an application in PB6.5 that interfaces with MSSQL 6.5 database.
>I can run this app WITHIN PB to make a connection the database and
>retrieve data without a problem, but after I built the EXE file and
>trying to run from that EXE file, I get a "-1" as the return code from
>the SetTransObject statement. Sample code is like :
>
>datastore lds_datastore
>lds_datastore = CREATE datastore
>lds_datastore.DataObject = "d_test"
>li_return = lds_datastore.SetTransObject(SQLCA)
>
>The d_test datawindow object consists of a simple SQL SELECT statement.
>
>Has anyone seen this problem before?? This is a VERY simple application,
>I'm not using an "ini" file and all database parameters are hardcoded in
>the OPEN event of the application object. I checked the connection after
>the OPEN event, and it's OK, I even incorporated an embedded SQL
>statement in a PB script and it executed it correctly. The strangest
>thing is I can run it successfully in the PB development environment but
>I can't after I built the EXE file!!! HELP!!!
>
>Thanks in advance
>
>Cassian Lee
>cklee@mmm.com
>


-1
Ron
8/26/1999 3:32:06 AM
Reply: