Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting SetTrans Error When I Didn't Before

Status
Not open for further replies.

hurricanedavid

Programmer
Sep 3, 2008
2
US
Code:
1|  open(w_report)
2|  w_report.dw_1.DataObject = "d_cat_breakdown"
3|  w_report.dw_1.SetTrans(SQLCA)
4|  if w_report.dw_1.Retrieve() = 0 then ....<snip>

This is the relevant part of the code that, up until recently, has been working fine.

Now, the debugger shows me that on line 4, an error is thrown when the Retrieve is attempted. Here's the error....

"Database transaction information not available.
Call SetTrans or SetTransObject function."


I had thought there may be some race condition issue going on (though there never has), in that my db may be taking too long to connect. But I don't know how to add in a command that would sleep/wait/pause processing for a half a second or so to test this theory.

I have captured the result of line 3, and it is 1, so everything seems good just before the Retrieve.

I found the window then datawindow in the object browser, and found Retrieve() under the Functions in that, but can't find Retrieve() when I go to the real datawindow.

I found the SqlPreview event of the dataWindow, and put a breakpoint in it with some "x=1" type code. But the debugger never stopped at that breakpoint.

I would appreciate any help!

PB: 9
PFC: Don't think I'm using it
Win: XP sp2
 
How is your SQLCA setup? Have you tried using another Transaction object?
 
I don't know how SQLCA is set up. And I can't remember how to get to it. I'm sure it's in some main file somewhere.

But I just tried something a friend suggested. I just replaced SetTrans() with SetTransObject() and it works now.

But I don't know why.
 
PB's Help has a bit of info on the two functions, but I'm sure you could dig up more on the web...

Sorry... In my first post I hadn't realized you were using SetTrans( )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top