Re: ADO request mistery

From: Wilfrid <grille11_at_yahoo.com>
Date: Fri, 20 Jun 2008 16:40:11 +0200
Message-ID: <485bc14c$0$10971$426a74cc@news.free.fr>


We do not send a sql request, we are using an ado record set in which we define for which column of the table we will put which data.

"Charles Hooper" <hooperc2000_at_yahoo.com> wrote in message news:8a769e8d-b98f-4111-8a68-d6167cfc6b81_at_d1g2000hsg.googlegroups.com... On Jun 20, 6:32 am, "Wilfrid" <grill..._at_yahoo.com> wrote:
> Hello,
>
> I am running an application on a client machine (server 2003 sp2) that
> uses
> the oledb driver to execute ado command (driver ODAC1020221.exe).
> It connects to an oracle server 10.2.0.1.0 installed on a windows server
> 2003R2 SP2. The oracle has nls_language AMERICAN and nls_territory.
>
> The application is regularly executing an update command. Some of the
> values
> are dates formatted as DD/MM/YYYY. The application then writes a variant
> of
> date type.
> Sometimes, oracle returns the error message: ORA-01841: (full) year must
> be
> between -4713 and +9999, and not be 0
> When i check what data the application has sent i can see:
>
> 732531;0;20/06/2008 08:46:58;20/06/2008 08:47:00;title;type;19/06/2008
> 00:00:00;69;349;349;0;0;5;;2;1;20/06/2008 08:46:13;
>
> One of the date is apparently taken as 0 event though the date we send has
> a
> normal format.
> In oracle 10, the view v$sql does not show the data inserted (only the
> variable of the update command.
>
> Now, this error started to appear few month ago (after installation of the
> system), on the same day we might have 3 or 4 errors (some requests worked
> some others not). We changed the regional settings of the 2 windows server
> (to US). It stopped for a little while and then re appeared again.
>
> What I do not understand is why it is working fine for weeks and then the
> errors appears from time to time with no apparent patterns.
> If anyone has an idea, please do not hesitate to share them with me!
>
> thanks in advance

I see a similar problem with one of the computers in our IT group when literal values with implicit type conversion are used rather than bind variables. I have not spent much time tracking down the problem - it may be a result of using an ODBC connection with ADO, or NOT using ODBC when using ADO directly against the database. Such a problem is an excellent excuse to implement the proper method using bind variables. If, for some reason, you cannot use bind variables, modify the SQL statement to perform an explicit data type conversion: INSERT INTO ... TO_DATE('20/06/2008','DD/MM/YYYY') ... Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Fri Jun 20 2008 - 09:40:11 CDT

Original text of this message