codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  access database date/time  pherms at 09:06 on Friday, May 20, 2005
 

Hi,

I have written some ASP code that queries an access database. Everything works fine, but when I query a databasefield which has the date/time format I get the following error

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

It's in the following sql query:

SELECT [orders pkw].[afl adres] as afl_adres,[orders pkw].[catogorie],[orders pkw].[prijsstelling],type,line,stallingsdd,levertijd,kleur,bekleding,automaat,uitvoering,[orders pkw].[Produktie maand] AS productiemaand,vraagprijs,kommnr,[orders pkw].[Uiterste wijz datum DCNL] AS uiterste_wijz,[orders pkw].[Convnr Autoline] AS convnr_aline,reserveringen from [orders pkw] where [orders pkw].[model]='V' and levertijd='31-12-2005' ORDER BY [orders pkw].[code];

I guess the error comes from the where clause, databasefield levertijd='31-12-2005'

I've set the page's locale to 1043 with this line of code:

@LCID=1043

I don't know what I'm doing wrong, because when I open the access database, the date/time fields contain the same date as the date I query the database for.


  Re: access database date/time  Zefiras at 15:26 on Monday, May 23, 2005
 

Hi!
In MS ACCESS data base you must make the querry on date using the tags #23-05-2005#
It does not accept '23-05-2005'



  Re: access database date/time  pherms at 15:27 on Monday, May 23, 2005
 

Great, thanks. I will try that this week.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Remote program execution using cgi-perl
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007