Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Validate date from VB to insert into Oracle table

Re: Validate date from VB to insert into Oracle table

From: Sybrand Bakker <gooiditweg_at_nospam.demon.nl>
Date: Thu, 12 Jun 2003 20:01:12 +0200
Message-ID: <pqfhev8kh3nsrg7ptuje68i708mds9g0v9@4ax.com>


On Thu, 12 Jun 2003 18:05:17 +0530, Me <me_at_privacy.net> wrote:

Comments embedded

>I have a problem in that the date format of VB and that of oracle 8i
>don't match
>
>For example:
>Private Sub Command1_Click()
> ' Check user input
>If Not IsDate(Text1) Then
> MsgBox "Sorry! That is not a valid date or Date/Time.", vbCritical
>& vbOK, "Error"
> Exit Sub
>End If
>
>Validates a date for VB but the same date format is not compatible
>with Oracle and I get an error when I try to insert values.
>How can this be solved?

Not compatible with Oracle! Geez, ever heard of to_date and to_char. Please read look up the sql reference manual before asking this type of question!!!

>
>Next, when ever I try to insert wrong values into tables from vb
>Eg a null value into an attribute that cannot be null, I get an error
>and the VB project is ended. How can I prevent this?
>i.e.

Not an Oracle problem. Look up exception handling in VB.

>Is there a way to get the error message (from oracle) show it to the
>user and then continue running the project?
>
>This question is probably for a VB group, but you know, I kind of feel
>at home here; after being flamed many times :)
>
>Thanks.

You are just asking for flames, sorry

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Thu Jun 12 2003 - 13:01:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US