Cant use VB6 to addnew or edit Informix 5 columns of datetime type
Posted in 2005
I'm using VB6 and Informix 5 on Solaris. I have a table with a column named TimeIn of type "datetime hour to second". I get a Runtime error '3146', ODBC-Call Failed when trying to enter a value into the TimeIn column. Here is the code Dim wksp As DAO.Workspace Dim db As DAO.Connection Dim rs As DAO.Recordset Set wksp = CreateWorkspace("", "admin", "", dbUseODBC) wksp.DefaultCursorDriver = dbUseODBCCursor Set db = wksp.OpenConnection("", dbDriverNoPrompt, False, "ODBC;DSN=myDSN;UID=myuserid;PWD=mypassword") Set rs = db.OpenRecordset("select * from table;", dbOpenDynaset, 0, dbOptimistic) With rs .addnew ' !TimeIn = Format$(Now, "HH:MM:SS") ' !TimeIn = "12/25/2005 11:11:11" ' !TimeIn = "11:11:11" ' !TimeIn = Time ' !TimeIn = #12/25/2005 1:11:11 PM# ' !TimeIn = #11:11:11 AM# ' !TimeIn = Now !TimeIn = Null .update End With The only attempt to not return an error was the Null value. Any help is greatly appreciated. Thanks, Jak