Reversing Dates on First Insert in DataEnvironment and VB6

From: taoiseachjoe (taoiseachjoe_at_discussions.microsoft.com)
Date: 11/04/04


Date: Thu, 4 Nov 2004 11:54:04 -0800

I am using a Command to INSERT a single row INTO an Access table. The
Date/Time fields are causing me grief by reversing the Day and Month - but
only on SOME rows.

On the FIRST Insert the date is Correct, but on subsequent Inserts the date
is reversed.

Here is my table after 4 inserts:
AppID AppStartDate AppEndDate
90 04/11/2004 12:15:00 04/11/2004 13:15:00
91 11/04/2004 12:15:00 11/04/2004 13:15:00
92 11/04/2004 12:15:00 11/04/2004 13:15:00
93 11/04/2004 12:15:00 11/04/2004 13:15:00

Here is the code which produces it:
Private Sub Command1_Click()
    Dim dtStart As Date
    Dim dtEnd As Date
    dtStart = #11/4/2004 12:15:00 PM#
    dtEnd = #11/4/2004 1:15:00 PM#
    de.dbo_PutAppointment dtStart, dtEnd
 End Sub

The dbo_PutAppointment command text in DataEnvironment is:
INSERT INTO Appointments (AppStartDate,AppEndDate) VALUES(?,?)

My Windows XP machine is set up for the UK Region - the data format is
dd/mm/yyyy

This is driving me crazy. Is it a bug or am I doing something wrong?

-- 
Joe Murray


Relevant Pages

  • Re: extra index scans on update
    ... Perhaps datatype of colx and x are different. ... Only a single row is updated for each ... > If I run the same command again, it works much faster because there are ... When I run the same command again, the row is in the cache and things ...
    (microsoft.public.sqlserver.programming)
  • Re: What is the Visual Basic command to select an entire row in Excel.
    ... Where Range is a cell address on the row you want to select. ... > single row in an Excel spreadsheet it selects all the rows in the ... Is there another command that will select a single row?? ...
    (microsoft.public.excel.programming)
  • Re: URLDownloadToFileW Error
    ... you are reversing the string. ... But I didn't see the command where you are reversing the actual character ... And I don't believe that command exists. ...
    (microsoft.public.windowsce.embedded.vc)
  • Unix script question (basic)
    ... if we were to put this into a loop to read every single row in the file and ... if so what can we have for 'command'? ... cat looks at a field at a time ...
    (comp.unix.questions)
  • Re: MERGE COMMAND WITH DECODE AND INNER SELECT
    ... Reversing the DBLINK, has done the trick. ... Intially the select/join of data was done locally(production database ... in other words the MERGE command ...
    (comp.databases.oracle.server)

Quantcast