Set currentTime = New Lcdatetime()
'Call currentTime.Setcurrent()
Set currentLCField = lcfields.Getfield( 1 )
Call currentLCField.Setdatetime( 1, currentTime )
Call con.Insert( lcfields, 1, 1)
Call con.Action( LCACTION_COMMIT )
Call con.Disconnect()
Exit Sub
ErrHandle:
Print "Error " & Err() & " line " & Erl() & ": " & Error$()
Exit Sub
If you modify the code slightly to run on DB2 instead, it works fine - it creates a row with a null populated datetime column.
Alternatively, if you uncomment the line that sets the value of currentTime, it runs fine on SQL Server and creates a row with a datetime column populated with the current time.