GetLastError method (DataWindows)
Description
Returns the error
code of the last database error that occurred in the Web DataWindow
server component.
Controls
DataWindow type |
Method applies to |
---|---|
Web |
Server component |
Syntax
[Web DataWindow server component]
1 |
long <span>dwcontrol</span><span>.</span><span>GetLastError</span> ( ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow server |
Return Values
Returns a numeric error code for the last database error that
occurred.
If dwcontrol is null, the method returns
null.
Usage
Call GetLastError and GetLastErrorString to
get information about database errors that caused SetAction, Update, Retrieve,
and RetrieveEx to return –1.
Examples
This code in a page server script calls Retrieve for
the Web DataWindow server component called dwComponent and gets
information about the database error if Retrieve fails:
1 |
retVal = dwComponent.Retrieve( ); |
1 |
if (retVal < 0) { |
1 |
Response.Write("Retrieval error: " |
1 |
+ dwComponent.<span>GetLastError</span>( ) |
1 |
+ "<BR>" |
1 |
+ dwComponent.GetLastErrorString( ) |
1 |
+ "<BR>"); |
1 |
} |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments