SeanNij
asked on
ODBC Call Failed when writing from MS Access to SQL Server Tables
Hi all,
Following code creates a ODBC --Call Failed error. Works on some machines / fails on others - all on same network/same server.
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
Dim CurrentDate As Date
CurrentDate = Date
Set dbs = CurrentDb
strSQL = "SELECT * FROM dbo_usrClockCards"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
rst.AddNew
rst!userID = Me.txtUserID
rst!ClockDate = CurrentDate
rst!ClockTime = Format(Now, "yyyy-mm-dd hh:mm:ss")
rst!ClockTypeID = 1
rst.Update
rst.Close
Set rst = Nothing
Set dbs = Nothing
Following code creates a ODBC --Call Failed error. Works on some machines / fails on others - all on same network/same server.
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
Dim CurrentDate As Date
CurrentDate = Date
Set dbs = CurrentDb
strSQL = "SELECT * FROM dbo_usrClockCards"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
rst.AddNew
rst!userID = Me.txtUserID
rst!ClockDate = CurrentDate
rst!ClockTime = Format(Now, "yyyy-mm-dd hh:mm:ss")
rst!ClockTypeID = 1
rst.Update
rst.Close
Set rst = Nothing
Set dbs = Nothing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Jim, Thanks.
Sent me in the right direction. Got some other nebulous "ODBC Optional Feature not implemented" message. Turns out to be field type on the SQL Tables.
Sent me in the right direction. Got some other nebulous "ODBC Optional Feature not implemented" message. Turns out to be field type on the SQL Tables.
Also,
dbo_usrClockCards
Is the ODBC connection setup properly for the above table? i.e. are you able to open that table from access within the Navigation Pane?