Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 377567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:42:33+00:00 2026-05-12T14:42:33+00:00

So, we have an old VB 6 App written many many years ago. It

  • 0

So, we have an old VB 6 App written many many years ago.


It uses an Access Database to store data, and the VB6 App as the interface to this data
Now, to change the VB6 app would be quite difficult, and I’m trying to avoid this.


The problem is, when the VB6 inserts data into a table in the access database, the table has a column which uses ‘Now()’ to set the default value.

Now there are calculations done on this date and time value, including multiplication. So.. when any of the date/time components are 0, the final result is 0.


I.E dd * mm * yy * hh * n * s – If any are zero, the result is zero


To overcome this I can

• Change the code to specify the date (not very ideal)

• hopefully in the default value of the Access Database put some validation to make sure there are no 0 values in the time


Is there any way to validate the default value like this?
Something like

If DatePart(‘hh’,date) == 0 OR DatePart(‘n’,date) = 0 OR DatePart(‘s’,Date) = 0
Then add one to all of them.

Edit
This is not my code, this is code written way before I, and ther other developers started.
We can’t be certain the code we have is the code being used in production. Hence why I’d rather not change code. We are planning on re-writing this soon, when time permits.
The problem only occurs once or twice a month, so it’s not vital to the running of the application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:42:33+00:00Added an answer on May 12, 2026 at 2:42 pm

    While it may not be ideal to edit the VB6 application, it would be the most robust way of dealing with the problem.

    Your proposal to alter the data itself seems like a very bad idea since it can potentially throw off dates if the data were ever to be used by another application later on. Better to let the application, with its unique requirements, transform the data at runtime to perform the calculations.

    Always store your data in the most standard, normalized format possible. You have no idea who will be using that data years from now when you’re no longer working there. The last thing you want is the bad karma of a new developer cursing your name because you thought it would be a good idea to alter the standard format for storing dates in a database.

    It is also worth noting that many Date() objects or date libraries already have ways of calculating the number of seconds in a particular date, so it could even simplify your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an old app I support (written in VB6) and it interfaces with
I have an app written in VB6 with a MDB database. When installing the
We have an old web app written in classic ASP. We don't have the
We have a 12-year-old Ms Access app that we use for our core inventory
I have an old app which did many UI initialization work in viewDidLoad of
I have to do a modification on an old COM+ app written in C#
We have an old Windows 32 bit app written in C++ which does some
I have an old vb6 app that I'm in charge of maintaining that saves,
I have a very old and poorly written Rails app. There are about 9000
I have an old web app where Javascript is used to validate some dates.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.