Re: out-of-range data error (2147217913)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Val Mazur (group51a_at_hotmail.com)
Date: 09/22/04


Date: Tue, 21 Sep 2004 22:00:14 -0400

Hi Ian,

Check the code were you pass this date. Are you using concatenation to build
SQL statement with this date? If yes, then this is the case. You would need
to use parameterized query to do it properly

-- 
Val Mazur
Microsoft MVP
"Ian Kidd" <ian.kidd@scottishfriendly.co.uk> wrote in message 
news:41c907de.0409200706.38104c95@posting.google.com...
> We have a vb app that loads from text files and inserts data into a
> SQL Server 2000 database.  This has been running successfully for a
> year, with no recent changes, yet in the last few days our users are
> getting the above error when trying to insert a date "20/09/2004" into
> the database table.
>
> I'm guessing this is something to do with date formats (if I change it
> to "09/20/2004" it works OK) but I can't think where to check.  PC
> settings are OK, users are set to "British English", and if you query
> the database, you seem to (now) have to use mm/dd/yyyy format in the
> query, but the results are shown as dd/mm/yyyy.
>
> I can't think what has changed recently; can anyone suggest where I
> should look next?
>
> I realise a solution would be to change the code to use yyyy-mm-dd
> format or something like that, but I'd rather know why this has
> suddenly started happening.
>
> Thanks for your help. 


Relevant Pages

  • Re: ADO data control
    ... Another way to test your query would be to try ... instinctively think that the database is probably not normalized. ... written on the topic of normalization, and one you might like is "Database ... Then the SQL statement and the existing WHERE and ORDER BY calculations ...
    (microsoft.public.vb.controls)
  • Re: Design View
    ... Can we assume that you put your database is a "trusted" location? ... Try the query again. ... it should print the SQL statement of the query into ... The same query opens fine in design view in Access 2000. ...
    (microsoft.public.access.queries)
  • Re: Design View
    ... Someone else may be able to provide a suggestion. ... I also checked references and they seemed fine for that database, ... Okay, Bob, the query contains the reserved word DATE as a field name. ... you may be able to get the SQL statement in A2007 opening the ...
    (microsoft.public.access.queries)
  • Re: Design View
    ... I also checked references and they seemed fine for that database, ... Okay, Bob, the query contains the reserved word DATE as a field name. ... you may be able to get the SQL statement in A2007 opening the ... The same query opens fine in design view in Access 2000. ...
    (microsoft.public.access.queries)
  • Re: Design View
    ... If it would be any help, I could e-mail you the database. ... Switch the problem query to SQL View, ... you may be able to get the SQL statement in A2007 opening the ... The same query opens fine in design view in Access 2000. ...
    (microsoft.public.access.queries)