Hi, Marie -
You have given us extremely little information to help you diagnose the problem. I suspect your application is not setting the Transaction object properties correctly.
Make sure your application is setting the Transaction object (SQLCA) properties to the same values you are using in the IDE. Edit the DB Profile that you know is working correctly. The "Preview" tab in the Database Profile Setup window will show you the PowerScript code you can place in your application to replicate those same settings in your application. There is also a "Test Connection" button in the Preview tab where you can verify that the settings defined in that DB Profile connect successfully.
Once you have assigned the connection properties to SQLCA, your app needs to connect the Transaction object to the database. This is typically done via the Connect command:
CONNECT Using SQLCA;
Your should always check the SQLCA.SQLCode property to see if the connection has been successfully established before proceeding. After a successful connection, the SQLCA.DBHandle() function will return a positive handle number.
In the future, keep in mind we are not mind readers (at least, I'm not), so please provide us with the PB version, release and build #'s of the version you are using. For database-related questions, please also include the database vendor, version and the SQLCA properties (mask out any sensitive information, such as server name and password). If you are receiving any errors/messages, it is a good idea to include error #'s and error text.
Best regards, John