473,804 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A97 - Can I trap 'n handle error #3315 inside my own error handler?

MLH
I get error 3315 when attempting to enter ZLS into
a text-type table field whose allow zls property is set
to false. The error says "Field MyTable.MyField can't
be a zero-length string"

For sure, this is what I expected, entering into a table.

The same 3315 error occurs if you try to enter "" into
a bound textbox control on a form (bound to the same
field. I expected that too.

I was wondering if its possible to trap this error and process
it with my own error-handler - when I see it form an open form.
Is this possible? And, if so, which of the applicable textbox
event properties should I try to do it in? I'm not sure it can be
done, as the ZLS is disallowed at the table level - not at the
form level.
Nov 13 '05 #1
5 2993
MLH wrote:
I get error 3315 when attempting to enter ZLS into
a text-type table field whose allow zls property is set
to false. The error says "Field MyTable.MyField can't
be a zero-length string"

For sure, this is what I expected, entering into a table.

The same 3315 error occurs if you try to enter "" into
a bound textbox control on a form (bound to the same
field. I expected that too.

I was wondering if its possible to trap this error and process
it with my own error-handler - when I see it form an open form.
Is this possible? And, if so, which of the applicable textbox
event properties should I try to do it in? I'm not sure it can be
done, as the ZLS is disallowed at the table level - not at the
form level.


Check the form's property sheet for OnError event. Check if the DataErr
value is 3315 and enter your own error message. Ex:
If DataErr = 3315 then
msgbox "Sorry, we need some data"
Response = acdataerrcontin ue
Endif

Nov 13 '05 #2
MLH
Thx, Salad. Haven't used that one before.
Will come in handy.

Check the form's property sheet for OnError event. Check if the DataErr
value is 3315 and enter your own error message. Ex:
If DataErr = 3315 then
msgbox "Sorry, we need some data"
Response = acdataerrcontin ue
Endif


Nov 13 '05 #3
I'd tend to use the texbox's BeforeUpdate event procedure:
You'd check for Err=3315, and set Cancel=True to prevent focus from
leaving the textbox.

I prefer this approach over the Form_Error, because it lets you handle this
error on its own; Form_Error will be triggered for any error which was not
previously handled.

"MLH" <CR**@NorthStat e.net> wrote in message
news:kr******** *************** *********@4ax.c om...
I get error 3315 when attempting to enter ZLS into
a text-type table field whose allow zls property is set
to false. The error says "Field MyTable.MyField can't
be a zero-length string"

For sure, this is what I expected, entering into a table.

The same 3315 error occurs if you try to enter "" into
a bound textbox control on a form (bound to the same
field. I expected that too.

I was wondering if its possible to trap this error and process
it with my own error-handler - when I see it form an open form.
Is this possible? And, if so, which of the applicable textbox
event properties should I try to do it in? I'm not sure it can be
done, as the ZLS is disallowed at the table level - not at the
form level.

Nov 13 '05 #4
MLH
Well now, that's interesting. I've heard of CancelEvent but not of
Cancel being used this way (set to True, that is). Searching HELP
in A97, I saw several things regarding Cancel. But nothing I saw
treated Cancel like an object that could be set to True or False.
I would appreciate a short code snippet - if you're feeling froggy.
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxx
I'd tend to use the texbox's BeforeUpdate event procedure:
You'd check for Err=3315, and set Cancel=True to prevent focus from
leaving the textbox.

I prefer this approach over the Form_Error, because it lets you handle this
error on its own; Form_Error will be triggered for any error which was not
previously handled.


Nov 13 '05 #5
MLH wrote:
Well now, that's interesting. I've heard of CancelEvent but not of
Cancel being used this way (set to True, that is). Searching HELP
in A97, I saw several things regarding Cancel. But nothing I saw
treated Cancel like an object that could be set to True or False.
I would appreciate a short code snippet - if you're feeling froggy.
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxx
I'd tend to use the texbox's BeforeUpdate event procedure:
You'd check for Err=3315, and set Cancel=True to prevent focus
from leaving the textbox.

I prefer this approach over the Form_Error, because it lets you
handle this error on its own; Form_Error will be triggered for any
error which was not previously handled.


Some events have a Cancel argument in the definition. Any that do can have that
argument set to zero within the event's code. BeforeUpdate is one such event.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2441
by: Mike D | last post by:
I have a table in SQL 2000 with a composite Primary Key on coulumns Instrument_ID (int) and WeekOf (smalldatetime.) I am running asp on win 2003. I insert values using a stored procedure from this ASP: InsertSQL = "Execute osp_insert_Instrument_Schedule " InsertSQL = InsertSQL & "@UserName = '" & strUserName & "', " InsertSQL = InsertSQL & "@DateInput = '" & Date() & "', " InsertSQL = InsertSQL & "@Instrument_ID = " & strInstrument_ID &...
3
2352
by: Eitan | last post by:
Hello, I want to emphasize a point for my prior posts : How can I trap a message in ASP (not dotnet), to a specific label. (I know : on error goto my_label ... but this does not work in ASP pages) Thanks :)
5
3517
by: bobdydd | last post by:
Hi Everbody I am trying to trap the error that SHOULD occur when there is no internet connection. Private Sub CmdPayHere_Click() On Error GoTo Err_CmdPayHere_Click Application.FollowHyperlink "http://www.microsoft.com" Err_CmdPayHere_Click: MsgBox "Page Not Available, Check that You ARE online",
5
73225
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
6
2877
by: Leandro Berti via DotNetMonster.com | last post by:
Hi All, I wrote a code to do serial communication with an equipament. When i use the code outside of threaded class it seens work properly, but when i put inside a class and execute a thread in the first seconds the communication is ok, later i receive read/write error. I?ve been in MSDN site and there i discover that the read/write error is a INVALID_HANDLE problem. But why??? I just create the serial communication file and use it....
3
9567
by: Timo | last post by:
In javascript code on MyPage.aspx, I set a hidden IFRAME's source url: myframe.location.href = 'someotherpage.aspx'; If the session has timed out, preventing someotherpage.aspx from being loaded into the IFRAME, where can that error condition be trapped? Thanks Timo
0
1323
by: Trevor Fairchild | last post by:
How can I trap a System.Runtime.InteropServices.ExternalException error? I am working with graphics and sometimes the graphics are corrupt and I end up getting: An unhandled exception of type 'System.Runtime.InteropServices.ExcternalException' occurred in system.windows.forms.dll. Additional Information: A generic error occurred in GDI+. I have a Try..Catch ex as Exception...End Try code wrapping the lines where the Picturebox.Image...
3
3156
by: Peterwkc | last post by:
Hello all C++ expert programmer, I have a handle class which point to another class and use the pointer as object. I follow the code from C++ articles submited by someone in this forum. Unfortunately, my compilation is failed. Below is my code : // Main.cpp
1
3306
by: Anjan Bhowmik | last post by:
I am getting this exception while binding data to Gridview. I have a control parameter that accepts a integer value from a TextBox. If i provide a invalid value, i get that exception. But can't handle it anywhere. I tried the ObjectDataSource's Selecting method handler, but failed. How do i cath those exceptions befor they rise? And Can you please provide me a link that explains the "Event Mechanism" in details, so that i gain acurate...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.