Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy record from 2 table.... (2000 sr -1)

    I dont know if is possible with internal comand of access.... or i must use a vb code?
    But...
    I have mdb with 2 table
    Table1 contain 28 fields and 989.567 records.
    Table2 contain 28 fields and no records.

    each table have the same name of fileds

    how to copy all records from table1 to table2...
    Tks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: copy record from 2 table.... (2000 sr -1)

    Create a new query in design view.
    Select Table1 and click Add. then Close
    Add Table1.* to the query grid.
    Select Query | Append Query.
    Specify Table2 as the target table and click OK.
    You have now created an append query.
    Select Query | Run to execute it.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy record from 2 table.... (2000 sr -1)

    and via code based on you old suggestion?
    Dubt on * to select all fileds;-(
    Sub RECOPY()
    Dim strCon As String
    Dim strSQL As String
    Dim cnn As Object
    strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDatabase_PERS & ";"
    Set cnn = CreateObject("ADODB.Connection")
    cnn.Open strCon
    strSQL = "INSERT INTO ANAGRAFICA2 SELECT DISTINCT * FROM ANAGRAFICA1"
    cnn.Execute strSQL
    'strSQL = "INSERT INTO tabella3 SELECT DISTINCT MANSIONE FROM tabella1"
    'cnn.Execute strSQL
    cnn.Close
    Set cnn = Nothing
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: copy record from 2 table.... (2000 sr -1)

    That should be OK.

Posting Permissions

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