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
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:
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
Ron Gallagher, CPDP
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 :
>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