Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

merging databases

I have two identical database - db1 and db2. I want to merge the data form db2 into db1. Using VB6 with ado. I can set and open connections to both databases and open recordsets if needed.

I want to try something like
INSERT INTO db1.table1
SELECT table1.*
FROM db2

Suggestions appreciated.

Comments

  • infidelinfidel Member Posts: 2,900
    : I have two identical database - db1 and db2. I want to merge the data form db2 into db1. Using VB6 with ado. I can set and open connections to both databases and open recordsets if needed.
    :
    : I want to try something like
    : INSERT INTO db1.table1
    : SELECT table1.*
    : FROM db2

    I know of no such syntax. When you write an SQL statement, you are giving the database instructions. db1 doesn't know anything about db2, let alone the connection objects in your VB code. The easiest option is to tell db2 to spit out all of the records you want to a text file, then have db1 load them all. That depends on your database, however. If that doesn't work, you can always get the recordset from one and iterate through it to insert records one by one into the other.
  • Andre YoungAndre Young USAMember Posts: 0

    __ \ http://forcoder.org \ free video tutorials and ebooks about < C Visual Basic Go JavaScript Ruby C# Swift Java Assembly PHP Objective-C MATLAB Scratch Perl PL/SQL C++ R Visual Basic .NET Python Delphi Hack FoxPro Scheme Kotlin VBScript Dart Transact-SQL Julia ML Awk Alice Prolog Lisp Rust D Fortran Crystal SAS Apex Scala Ada LabVIEW COBOL Bash F# Erlang Lua Clojure Logo ABAP /> ______________

Sign In or Register to comment.