Results 1 to 4 of 4
  1. #1
    ped's Avatar
    ped is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    51

    Retrive Bulk Data - from Different database into this table.

    Hi, how can i retrive Bulk Data - from Different database into this database table. At the moment i loop through all the records which is not good idea...i want it to be real quick without linking the table...
    I heard something like Insert into stament can work but have never used one...



    Thanks everyone.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Ped...isn't this what I helped you with before? and now your back asking the same question?

    visual basic has the ability to use the 'IN' statement to execute queries between multiple databases, but you can't do that inside of an access database. You have to use code to open it.

    I already taught you how to use DAO and ADO.

  3. #3
    ped's Avatar
    ped is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    51
    ajetrumpet, are you referring to this? apologies...
    actually i want to transfer data all together like insert into this table from that database table.

    I tried the insert statement given in help but wont work for me cox, idont know hwo to make it work.

    Code:
    Sub test333_1() 
      
    Dim db As dao.Database 
    Dim rs As dao.Recordset 
     
    Set db = OpenDatabase("E:\Personal_Files\Access\MAINDB.accdb", False, False, "MS Access;PWD=password") 
    Set rs = db.OpenRecordset("BTLog") 
     rs.MoveFirst 
     While Not rs.EOF 
     Debug.Print rs.Fields(1) 
     rs.MoveNext 
     Wend 
    rs.Close 
    db.Close 
      
    rs.Close 
    db.Close 
      
    End Sub

  4. #4
    ped's Avatar
    ped is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    51
    I tried this way and it errored:
    RUNTIME ERROR 3192, Could not find output table.
    my output table is in current database Budget_INFO1

    Thanks again.
    Code:
    Dim dbs As Database
        Dim rst As DAO.Recordset
        ' Modify this line to include the path to Northwind
        ' on your computer.
        Set dbs = OpenDatabase("E:\Personal_Files\Access\Database4.accdb")
        Set rst = CurrentDb.OpenRecordset("Budget_INFO1", dbOpenDynaset)
        
        ' Select all records in the New Customers table
        ' and add them to the Customers table.
        dbs.Execute " INSERT INTO Budget_INFO1 " _
            & "SELECT * " _
            & "FROM [Budget_INFO];"
            
        dbs.Close
    



Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-15-2011, 10:52 PM
  2. Replies: 1
    Last Post: 11-04-2010, 12:57 PM
  3. Replies: 4
    Last Post: 08-12-2010, 08:38 AM
  4. Bulk Email / Loop through recordset
    By smikkelsen in forum Forms
    Replies: 4
    Last Post: 07-12-2010, 06:59 PM
  5. Replies: 2
    Last Post: 02-14-2010, 01:38 PM

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