Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2006, 12:39 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default [to_char] in Access

hi Frnds!

   I've a project which was connected with Oracle Database. But now I connected it to the MS Access but when I run the programme I'm getting Run Time Error:


-[Microsoft][ODBC Microsoft Access Driver] Undefined function 'to_char' in expression.-


I'm using the statement here:


rs.open "select sum(COLUMNNAME) from TABLENAME where to_char(DATE_FIELD_NAME, 'mon-yyyy') = 'Feb-2006'",con,....


Can someone help me how can we raise date_field from Access with this format?

Thanks in Advance.

Deepak..
__________________
DPK..
 
Old February 13th, 2006, 11:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

there is no to_char function in access.. try with the format functions (work the same as in VB)

HTH

Gonzalo
 
Old February 13th, 2006, 11:58 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default

Thanks Gonzalo,

    I know about the VB's Format function but i wanted to convert this through ACCESS DATABASE. So is there really nothing function in access to do this.


Thanks again to reply.

Deepak..
 
Old February 14th, 2006, 02:31 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi dpkbahuguna,

This error occured because of syntax changes in Oracle and Access. If you have designed the application properly, you can use a different dll to Access database or else Write 2 sql statements for oracle, check the provider and select the SQL statement according to the provider.

nalaka hewage
 
Old February 14th, 2006, 09:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..
maybe i explain myself wrong. in access use the same function, Format works in access too.

HTH

Gonzalo
 
Old February 15th, 2006, 01:04 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default

Thanks Nalla & Qbianchi,

     Now I got the solution through Access's Format function.

     One more thing I use [Microsoft.jet.oledb.4.0] Provider. How can I know that which provider is installed in my computer & how can I upgrade it.

Thanks....

Deepak..
 
Old February 16th, 2006, 01:31 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi dpkbahuguna,
   I seems you are going to maintain 2 sources for Oracle and Acces. This will make your life difficult.

   You are the one who's going to install the provider(Oracle and Access). So when you are distributing the application use INI file or registry to save the provider. and use a encrypt/decrypt method if you have any concerns about security. according to the provider, select the sql statement written to support Oracle OR Access.


nalaka hewage
 
Old September 29th, 2006, 05:05 AM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dear all i got same problem in to_cher function

please any one can tell me wht is the solution of this in format and hw i can do this ?


 
Old September 29th, 2006, 08:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

what's the problem???

HTH

Gonzalo
 
Old October 6th, 2006, 06:37 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default

dear friend just use it....

SELECT format(date, "dd-mmm")
FROM Table1;


Quote:
quote:Originally posted by nir.the
 dear all i got same problem in to_cher function

please any one can tell me wht is the solution of this in format and hw i can do this ?


DPK..





Similar Threads
Thread Thread Starter Forum Replies Last Post
401.3 Access denied due to Access Control List cforsyth .NET Framework 2.0 8 May 28th, 2009 01:56 PM
SQL Access/ASP.NET data access issue saeta57 SQL Server ASP 1 July 4th, 2004 04:29 PM
SQL Access/ASP.NET data access issue saeta57 Classic ASP Databases 1 July 4th, 2004 03:32 PM
ADE file in Access 2000 <---> Access XP ginoitalo Access 3 April 14th, 2004 09:06 PM
Access XP VBA compatibility issues w/ Access 2000 bourgeois02 Access VBA 1 August 19th, 2003 04:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.