 |
| 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
|
|
|
|

February 13th, 2006, 12:39 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
|
|
[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..
|
|

February 13th, 2006, 11:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
hi there...
there is no to_char function in access.. try with the format functions (work the same as in VB)
HTH
Gonzalo
|
|

February 13th, 2006, 11:58 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
|
|
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..
|
|

February 14th, 2006, 02:31 AM
|
|
Friend of Wrox
|
|
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

February 14th, 2006, 09:53 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
hi there..
maybe i explain myself wrong. in access use the same function, Format works in access too.
HTH
Gonzalo
|
|

February 15th, 2006, 01:04 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
|
|
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..
|
|

February 16th, 2006, 01:31 AM
|
|
Friend of Wrox
|
|
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

September 29th, 2006, 05:05 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ?
|
|

September 29th, 2006, 08:27 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
what's the problem???
HTH
Gonzalo
|
|

October 6th, 2006, 06:37 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
|
|
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..
|
|
 |