Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

Transfer records from one table to another

I am trying to select certain records from one table and then place ALL the values retrieved into another table.

For example, if I retrieve all the records (Text1,Text4,Text5,Text7) for Table A.  How can I save the records temporarily, so that I can close the current table and then open another table so that I can place all the data in Table B?

Hope that makes sense.  
If conn.State = adStateClosed Then
        conn.Open "Provider=sqloledb;Data Source=" & ConnectionIP & ",1433;Network Library=DBMSSOCN;Initial Catalog= CAPRegistration; User ID=sa;Password=xxxx"
        End If
        
        esql = "select Text1 , Text4, Text5, Text7 From tblRegistration Where Committee = " & ravi & DataGridOrganization & ravi

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of game-master
game-master
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of al4629740

ASKER

Thank you.

YOURTABLE is my destination table?

also, what does "rs!" represent?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
They are in separate dbs.

Also, yes I need to add a new record when pasting the fields


good morning!

if they're in different dbase, then u need 2 connection string...



game-master
will it automatically add a new record?

INSERT INTO TABLEB ("Text1 , Text4, Text5, Text7) select Text1 , Text4, Text5, Text7 From tblRegistration

YES IT WILL...

THE RS! MEANS YOUR POINTING ON THE REcords on your 'rs' recordset...



game-master
INSERT INTO TABLEB ("Text1 , Text4, Text5, Text7) select Text1 , Text4, Text5, Text7 From tblRegistration

Is there suppose to be quotation marks before Text1 ?


REMOVE THE QUOTATION MARK BEFORE THE TEXT1....