Monday, May 24, 2010

Now() In ODBC SQL Query?

Programmer Question

I'm trying to update a database field to the current time, but can't pass "now()". I get the following error:



'now' is not a recognized built-in function name.



The method I'm using to query the database is as follows:



Public Sub main()

Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset

Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset

cnn.Open "ConnectionName"
rst.ActiveConnection = cnn
rst.CursorLocation = adUseServer

rst.Source = "Update Table ..."
rst.Open

Set rst = Nothing
Set cnn = Nothing
End Sub


Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails