Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 41
  1. #16
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250

    Some more info:
    https://stackoverflow.com/questions/...-linked-tables
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  2. #17
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    430
    can you just run an Update Query rather than using recordset:
    Code:
    Dim db As DAO.Database
    Dim sql As String
    Dim nYear as Integer
    nYear = Year(Date)
    If Month(nDate) > 8 Then
        nYear = nYear + 1
    End If
    sql =  "Update LibroSoci Set [Quota associativa] = " & nYear & " WHERE [Numero Tessera] = " & NTes
    Set db = Currentdb
    With db
        .Execute sql, dbFailOnError
        Msgbox .RecordsAffected & " record(s) updated"
    End With
    Set db = Nothing

  3. #18
    roberto21 is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2019
    Posts
    89
    No, I don't have any YES/NO or TRUE/False column in the table, no floating items either. And in this situation, I am not trying to update the record from a form (other suggestion found somewhere).

  4. #19
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Can you update the table manually? What about the update query suggested above?
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #20
    roberto21 is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2019
    Posts
    89
    Sorry for the late answer, we have also a time sync problem ( I am in Italy).
    Yes, no problem in update the table manually.
    As per the code of jojo white (thank you, by the way), no luck; same error at .Execute sql instruction.

  6. #21
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    430
    what are the field type of these two fields:
    Code:
    [Quota associativa]
    [Numero Tessera]

    If one or both are String you need to add Delimeter on your SQL string.
    eg, [Numero Tessera] is string:
    Code:
    sql=
    Code:
    "Update LibroSoci Set [Quota associativa] = " & nYear & " WHERE [Numero Tessera] = '" & NTes & "'"

  7. #22
    roberto21 is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2019
    Posts
    89
    Both [Quota associativa ] and [Numero Tessera] are defined as INT
    Click image for larger version. 

Name:	Screenshot 2025-07-24 111552.png 
Views:	13 
Size:	64.6 KB 
ID:	53155

  8. #23
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    430
    i downloaded and install mysql 8.4.6 (x64)
    created a sample database (test) and table test
    Click image for larger version. 

Name:	db.png 
Views:	12 
Size:	24.9 KB 
ID:	53156

    i run the code i posted and the code goes well (without any error).

  9. #24
    Minty is offline VIP
    Windows 11 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Does it not need a dbSeeChanges option added on in the SQL.Execute

    SQL Server would.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  10. #25
    roberto21 is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2019
    Posts
    89
    I had dbSeeChanges in the code using Recordset. Curiously, if I try to add dbSeeChanges to the .execute statement, like this
    .Execute strSql, dbFailOnError, dbSeeChanges
    I get a compile error

    Compile error:
    Wrong number of arguments or invalid property assignment




    Jojowhite, are you suggesting that Mysql 9.3 introduced a bug not present in the earlier versions? Did you also use the old drivers? I am using odbc driver unicode 9.3. I could try using an old driver too (not sure if they are compatible with mysql 9.3), or I have to reinstall everything using the old version to test. This will require some time.

  11. #26
    roberto21 is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2019
    Posts
    89
    All right, tested with driver 9.2,9.1, 9.0, 8.4 with same error. Will reinstall mysql 8.4.6.

  12. #27
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    430
    i ran the code without dbSeeChanges and it runs fine.

  13. #28
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    430
    you should run it with or without dbSeeChanges:

    Code:
    .Execute strSql, dbSeeChanges

  14. #29
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    I didn't see the timestamp column in the post #22...
    When you did the connection to the backend what options have you selected?
    https://dev.mysql.com/doc/connector-...ft-access.html
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  15. #30
    roberto21 is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2019
    Posts
    89
    I removed the timestamp field, because, even inserting it, I had the same error,
    But now the news, that for me are unbelievable. I installed MySQL server 8.4.6, and copied the database from the server 9.3 I had to redefine the primary keys again, must be a deficiency of dbeaver. Anyway, I relinked the frontend with driver 8.4, retested and ggot the same error.Oh well, what can I do? Just for the fun of it, I changed the .execute instruction to

    db.execute strSQL, dbSeeChanges


    replacing dbFailOnError with dbSeeChanges. Retested and, would you believe, NO ERROR! It worked!!! Just to make sure, I reverted to


    db.execute strSQL, dbFailOnError


    retested, and it worked again!!
    Now I had to proceed, so I went back to the database in the server 9.3, relinked the frontend with driver 9.3, and the damn thing worked again, in exactly the same situation as before when I could not get rid of the error. If someone has an explanation of this bizarre behavior, I would like very much to learn it. The problem is that, should the error pop out again, I still do not know the cause.
    Thank you all for helping me.


    PS. Is there a reason why I keep getting kicked out of the forum? I had to logon five times to write this message.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 16
    Last Post: 04-02-2020, 04:49 PM
  2. Inserting Data to Access Table (Local) from MySQL table (Net)
    By gambit1430 in forum Import/Export Data
    Replies: 2
    Last Post: 09-26-2014, 01:34 AM
  3. Replies: 7
    Last Post: 03-02-2014, 08:47 PM
  4. Replies: 5
    Last Post: 05-16-2012, 12:48 AM
  5. mySQL statement not updating table!!
    By Ran in forum SQL Server
    Replies: 3
    Last Post: 01-10-2012, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums