Solved

Using sysdate in VB

Posted on 2002-04-03
8
3,249 Views
Last Modified: 2008-02-01
Hi,

I have a program which has a date when a new row is entered, but I want this date to use sysdate from oracle as opposed to now in vb, but I am not sure if it is possible other than to use a trigger, or straight insert into statement.


.AddNew
!StatusLogID = GetNextId
!STATUSLOGDATEOFCHANGE = Format(Now(), "dd-mmm-
.update
0
Comment
Question by:damienm
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6915359
The only way I have managed to do this is with a SQL statement, in your case an Insert.

Anthony
0
 

Expert Comment

by:mmonacel
ID: 6916274
I would suggest what Anthony had said - write the date as you enter into the DB.  Maybe you can "fake it" by after inserting the record, making a call to retrieve that value from the DB and display it on the screen.  Seems like a lot of overhead to do just to display a date, but if you need it...

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6916421
mmonacel

I suspect damienm needs the Server date/time not the workstation date/time.

Anthony
0
 
LVL 39

Expert Comment

by:appari
ID: 6916797
or in formload get date from oracle by opening a recordset, keep that in a form level variable and use it whenever you want. but take care to handle the special cases like form may be loaded at 23:59 and update is done at 00:01 the next day ( after 2 minutes).
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6916836
appari,

I suspect damienm is looking for the time as well.

Anthony
0
 
LVL 39

Accepted Solution

by:
appari earned 50 total points
ID: 6916873
why dont you define a default on that column and assign datevalue and forget about its updation?

like

create table test1( A1 date default sysdate,A2 char(2))

0
 
LVL 2

Author Comment

by:damienm
ID: 6917411
This is what I did, except by using alter table.

i.e.

alter table statuslogs
modify (statuslogdateofchange default sysdate)

so that I do not need to put this into the insert statement.
0
 
LVL 2

Author Comment

by:damienm
ID: 6917414
This is what I did, except by using alter table.

i.e.

alter table statuslogs
modify (statuslogdateofchange default sysdate)

so that I do not need to put this into the insert statement.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now