Results 1 to 4 of 4

Thread: How i insert rows in a table

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2021
    Posts
    18

    How i insert rows in a table

    This insert not insert nothing why?

    Set rdoQry.ActiveConnection = cnMySql
    Set rdoRS = rdoQry.OpenResultset(rdOpenKeyset, rdConcurRowVer)

    Do Until rdoRS.EOF
    insertQry.SQL = "INSERT INTO magazzino_media (codice_articolo,quantita,data_giacenza) VALUES ('" & rdoRS!codice_articolo & "', '" & rdoRS!q_art & "','" & Date & "')"
    Debug.Print insertQry.SQL
    Set insertQry.ActiveConnection = cnMySql
    Set rdoRS1 = insertQry.OpenResultset(rdOpenKeyset, rdConcurRowVer)
    rdoRS.MoveNext
    Loop

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Feb 2021
    Posts
    18

    Re: How i insert rows in a table

    it insert only 6 rows of 30.000

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,871

    Re: How i insert rows in a table

    You are not using ADO it seems??

    Instead of taking the results of a previous query and do a lot of queries for the complete recordset you can also rewrite your "INSERT"
    https://www.w3schools.com/sql/sql_in...nto_select.asp

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2021
    Posts
    18

    Re: How i insert rows in a table

    solved, thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width