Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
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 24th, 2009, 07:53 AM
Authorized User
Join Date: Jan 2009
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
Default Converting Label.caption as Date value

In my AccessDB the column monthDate having data type: “date”. In VB6.0 label.caption is the value which I need to save in monthDate.

Like: Label1.caption= 2/24/09.
Problem is how will I convert the label.caption as date value so that i can save it in monthDate column.

I don’t want to change the data type of monthDate column coz lot of reports to be generated on date reference.

Can any one help me please???

Old February 24th, 2009, 09:07 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

Hi there..

You should pass the date field surrounded by ## if you are using a direct SQL query. If you are filling a recordset, just pass the value... VB will handle the conversion for you...


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
================================================== =========
I know that CVS was evil, and now i got the
================================================== =========
Old March 5th, 2009, 04:55 AM
Authorized User
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via ICQ to debasisdas Send a message via AIM to debasisdas

you need to parse the date to proper format before passing the same to the database for further processing.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VB : How to change Label Caption papanchal Excel VBA 1 September 22nd, 2008 04:46 PM
Problem converting string to Date. akhilhp ASP.NET 2.0 Basics 2 July 6th, 2008 08:02 AM
Converting to character from date string denver Access VBA 7 June 9th, 2006 07:30 AM
saving changes to label caption Loralee Access 5 January 6th, 2006 09:53 PM
converting date to julian date ramlaks SQL Server 2000 1 August 23rd, 2004 10:28 AM

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