Solved

Using sysdate in VB

Posted on 2002-04-03
8
3,300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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