Re: VB6, DAO, Oracle and dates....

From: Eric Fortin <emfortin_at_attbi.com>
Date: Fri, 26 Jul 2002 13:06:28 GMT
Message-ID: <nPb09.43781$uh7.5728_at_sccrnsc03>


Without seeing your code, there is very little that can be done. (connection and select statements)

I've used DAO with the to_date function successfully.

It appears that you are:

  1. Accessing Oracle through MS Access linked tables?
  2. Accessing Oracle through a DSN using the Jet Driver? (I'm not even sure if there even is such a thing)

if either the above are correct, it appears your only hope is using dbSQLPassThrough in the openrecordset (db.OpenRecordset(query, dbOpenDynaset, dbSQLPassThrough)) . This sometimes works and sometimes does not...

It also could be that your DAO library is not 3.6 (which has a lot of bug fixes).

The best suggestion would be to use OO4O. You should also use a DSN that uses the Oracle Drivers.

Sorry I couldn't be more help.

You might try:
 microsoft.public.vb.database
 microsoft.public.vb.databases.dao

Also, if any of the above assumptions are correct, "Nyami" <nyami_at_hotmail.com> wrote in message news:d5bd14e9.0207260211.74528b4f_at_posting.google.com...
> I have an Oracle 8.1 database and using the oracle 7.3.4 client (there
> is a good reason and can't be avoided). I have a VB6 project that uses
> DAO and need to get some queries working that have a where clause on
> the date fields. The date fields in the database have a time stamp
> which in this case I do not need to take into consideration. In
> SQLPlus I can run the following query and get the results I expect.
> Select * from ... where to_date(My_Date_Field,'DDMM/YY') =
> to_date('13/6/2002' ,'DD/MM/YY');
>
> Problem is I can not use this syntax in the query definition, every
> time I try and return my record set with this query definition I get
> the following error:
> Error Code: 3085
> Description: Undefined function 'to_date' in expression.
> I have two possible ways round this but both require large changes in
> the code and/or environment, they are to create a view that converts
> the date, or to change the odbc drivers etc, both of which are not
> ideal.
>
> Is there any thing I am missing, I am hoping that its going to be so
> simple. I have seen a few workarounds for formatting the parameter (ie
> right hand side of equals) but I need to convert the field being
> returned (ie left).
>
> Cheers
> Nyami
Received on Fri Jul 26 2002 - 15:06:28 CEST

Original text of this message