Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 12th, 2006, 11:39 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: Hardwar, Uttranchal, India.
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 Send a message via Skype™ 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..
Reply With Quote
  #2 (permalink)  
Old February 13th, 2006, 10:17 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,190
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
Reply With Quote
  #3 (permalink)  
Old February 13th, 2006, 10:58 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: Hardwar, Uttranchal, India.
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 Send a message via Skype™ 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..
Reply With Quote
  #4 (permalink)  
Old February 14th, 2006, 01:31 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
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
Reply With Quote
  #5 (permalink)  
Old February 14th, 2006, 08:53 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,190
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
Reply With Quote
  #6 (permalink)  
Old February 15th, 2006, 12:04 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: Hardwar, Uttranchal, India.
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 Send a message via Skype™ 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..
Reply With Quote
  #7 (permalink)  
Old February 16th, 2006, 12:31 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
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
Reply With Quote
  #8 (permalink)  
Old September 29th, 2006, 05:05 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
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 ?


Reply With Quote
  #9 (permalink)  
Old September 29th, 2006, 08:27 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,190
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

what's the problem???

HTH

Gonzalo
Reply With Quote
  #10 (permalink)  
Old October 6th, 2006, 06:37 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: Hardwar, Uttranchal, India.
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 Send a message via Skype™ 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..
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 03:31 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.