In a Notes db, I have code that’s intended to insert the current date/time into a table of a relational db in the format yyyy-mm-dd hh:mm:ss.
The date/time is captured in a string in the proper format as follows. (I confirm this with a messagebox).
Dim varTimeStamp As Variant
Dim strTimeStamp As String
varTimeStamp = Now()
strTimeStamp = “'” & Format( varTimeStamp, “yyyy-mm-dd hh:mm:ss”) & “'”
However, an insert statement fails when it refers to strTimeStamp as follows:
{’ , } & {strTimeStamp} & { , '}
I’ve tried variations of the above code and all have failed, usually with the error ‘ODBC could not complete the requested operation.’
If the date/time is hard-coded as follows, the insert is successful.
{’ , } & {‘2008-10-31 18:00:00’} & { , '}
I’d appreciate any ideas on what is required to insert into a table the current date/time in the format yyyy-mm-dd hh:mm:ss.
Thanks.