Unix Technical Forum

Re: Validate date from VB to insert into Oracle table

This is a discussion on Re: Validate date from VB to insert into Oracle table within the Oracle Miscellaneous forums, part of the Oracle Database category; --> At the risk of asking an obvious question have you tried format() ? I have been doing a bit ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 08:49 AM
mpduncan02
 
Posts: n/a
Default Re: Validate date from VB to insert into Oracle table


At the risk of asking an obvious question have you tried format() ?

I have been doing a bit of VB<>mySQL and its mySQL dates are non VB
friendly also.

Whenever I need to store a date value in mySQL i use something like:
' Set up the SQL update.
strSQL="UPDATE the_table SET this_date ='" &
format(strThisDate,"YYYY-MM-DD") & "' WHERE index = '" &
intIndexPointer &"'"
' Now send it to the database
dbConn.execute strSQL





Originally posted by Me
> 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?
>
> 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.
> 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.

--
Posted via http://dbforums.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com