Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread TimeStamp fields
Tue, Apr 24 2007 11:26 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi,

I am having trouble updating a TimeStamp field via the ODBC driver.

   I can update  a Date field using the following:

LogCommand.SQL = "INSERT INTO EventLog (LogDate,Message) VALUES(?,?)";
LogCommand.Parameters.Add("LogDate", OdbcType.Date);
LogCommand.Parameters.Add("Message", OdbcType.VarChar, 50);
LogCommand.Parameters["LogDate"].Value = DateTime.Today;
LogCommand.Parameters["Message"].Value = "Test Message";
LogCommand.ExecuteNonQuery();

   But if I try and update a TimeStamp Field using the following nothing gets saved to the table:

LogCommand.SQL = "INSERT INTO EventLog (LogDate,Message) VALUES(?,?)";
LogCommand.Parameters.Add("LogDate", OdbcType.DateTime);   // Changed to DateTime
LogCommand.Parameters.Add("Message", OdbcType.VarChar, 50);
LogCommand.Parameters["LogDate"].Value = DateTime.Now;      // Include Time with Date
LogCommand.Parameters["Message"].Value = "Test Message";
LogCommand.ExecuteNonQuery();

   I have alos tried using a TimeStamp type instead of DateTime but it does not like the data format:

LogCommand.SQL = "INSERT INTO EventLog (LogDate,Message) VALUES(?,?)";
LogCommand.Parameters.Add("LogDate", OdbcType.TimeStamp);   // Changed to TimeStamp
LogCommand.Parameters.Add("Message", OdbcType.VarChar, 50);
LogCommand.Parameters["LogDate"].Value = DateTime.Now;      // Include Time with Date
LogCommand.Parameters["Message"].Value = "Test Message";
LogCommand.ExecuteNonQuery();

This last query complains about the format of the "LogDate" field.

Any ideas?

Chris Holland
Wed, Apr 25 2007 8:30 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< But if I try and update a TimeStamp Field using the following nothing
gets saved to the table: >>

Hmmm, that's odd.  You should at least get a new row with possibly incorrect
data in the timestamp column.   Did you try turning on the ODBC trace
facilities and see if the INSERT is actually being executed ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Apr 25 2007 10:07 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

I should have explained that better.

When I said nothing gets saved to the table I meant in the TimeStamp field.
A new record is created but the TimeStamp field is empty.

Chris

Tim Young [Elevate Software] wrote:
> Chris,
>
> << But if I try and update a TimeStamp Field using the following nothing
> gets saved to the table: >>
>
> Hmmm, that's odd.  You should at least get a new row with possibly incorrect
> data in the timestamp column.   Did you try turning on the ODBC trace
> facilities and see if the INSERT is actually being executed ?
>
Thu, Apr 26 2007 10:29 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

I have posted a sample application to the binaries newgroup.

Chris


Tim Young [Elevate Software] wrote:
> Chris,
>
> << But if I try and update a TimeStamp Field using the following nothing
> gets saved to the table: >>
>
> Hmmm, that's odd.  You should at least get a new row with possibly incorrect
> data in the timestamp column.   Did you try turning on the ODBC trace
> facilities and see if the INSERT is actually being executed ?
>
Fri, Apr 27 2007 9:39 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< I should have explained that better.

When I said nothing gets saved to the table I meant in the TimeStamp field.
A new record is created but the TimeStamp field is empty. >>

Could you post a compiled version that uses a direct path of
c:\testdatetime\bin\data ?  I can't debug the ODBC driver DLL with the VS
exe using a relative path, and I don't have VS2005 installed (just VS2003)
and I'd rather not go through that installation process right now if I can
help it. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Apr 30 2007 3:11 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

Have posted the modified solution.

Chris

Tim Young [Elevate Software] wrote:
> Chris,
>
> << I should have explained that better.
>
>  When I said nothing gets saved to the table I meant in the TimeStamp field.
> A new record is created but the TimeStamp field is empty. >>
>
> Could you post a compiled version that uses a direct path of
> c:\testdatetime\bin\data ?  I can't debug the ODBC driver DLL with the VS
> exe using a relative path, and I don't have VS2005 installed (just VS2003)
> and I'd rather not go through that installation process right now if I can
> help it. Smiley
>
Thu, May 3 2007 7:55 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

Have you had a chance to look at this problem yet?

Chris

Tim Young [Elevate Software] wrote:
> Chris,
>
> << I should have explained that better.
>
>  When I said nothing gets saved to the table I meant in the TimeStamp field.
> A new record is created but the TimeStamp field is empty. >>
>
> Could you post a compiled version that uses a direct path of
> c:\testdatetime\bin\data ?  I can't debug the ODBC driver DLL with the VS
> exe using a relative path, and I don't have VS2005 installed (just VS2003)
> and I'd rather not go through that installation process right now if I can
> help it. Smiley
>
Mon, May 7 2007 12:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< Have you had a chance to look at this problem yet? >>

Yes, I did.  Sorry for the delay.  The problem was with the way we are
handling fractional times in the ODBC parameters, and a new build for DBISAM
will be available either today or tomorrow to fix it.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, May 7 2007 2:58 PMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

Thanks for that, I am  on holiday for a week now so no rush

Chris Holland

Tim Young [Elevate Software] wrote:
> Chris,
>
> << Have you had a chance to look at this problem yet? >>
>
> Yes, I did.  Sorry for the delay.  The problem was with the way we are
> handling fractional times in the ODBC parameters, and a new build for DBISAM
> will be available either today or tomorrow to fix it.
>
Image