简体   繁体   中英

ODBC--Call failed on RecordSet

Hellow i need your help i have a access database software, so i decided to migrate into sql server by sql migration assistant after that i tested my linked tabled to my access Graphical user, but fails some of code it seems doesn't applied in that are linked in sql server my code is

Dim Activity As Recordset

Set Activity = CurrentDb.OpenRecordset("UserActivity")
        
        Activity.AddNew
        
        Activity!ActivityType = "Login To Afya DB"
        Activity!RefDocument = Me.Name
        Activity!Description = "User Has Seen Home_Page"
        Activity!UserName = Me.txtUserName.Value
        Activity!ActionedOn = Format(Now(), "dd/mm/yyyy")
         
Activity.Update

I have tryed to add dbSeeChanges

Set Activity = CurrentDb.OpenRecordset("UserActivity", dbOpenDynaset, dbSeeChanges)
        
        Activity.AddNew
        
        Activity!ActivityType = "Login To Afya DB"
        Activity!RefDocument = Me.Name
        Activity!Description = "User Has Seen Home_Page"
        Activity!UserName = Me.txtUserName.Value
        Activity!ActionedOn = Format(Now(), "dd/mm/yyyy")
         
Activity.Update

But still give this Massage i get wen am starting excuting and When i debug the problem is

Activity.Update

Always pass true date values to a date/time field; Format returns text.

Also, list the error information if any. So:

Set Activity = CurrentDb.OpenRecordset("UserActivity", dbOpenDynaset, dbSeeChanges)
        
Activity.AddNew
      
    Activity!ActivityType = "Login To Afya DB"
    Activity!RefDocument = Me.Name
    Activity!Description = "User Has Seen Home_Page"
    Activity!UserName = Me.txtUserName.Value
    Activity!ActionedOn = Date
         
Activity.Update

' Print ODBC error.
Debug.Print Errors(0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM