|
-
Aug 21st, 2000, 02:37 PM
#1
Thread Starter
Addicted Member
I was wondering if anyone knew if it is possible to copy a recordset or a row from a recordset to another recordset or row of a recordset. Clear as mud? For example... I have a dBase database and I want to copy a bunch of rows from one of the dbase tables to a sql server database table. what is the fastest way to do this.. any ideas? right now I have it looping through every field of every row and copying everything field by field... there has to be a faster way to do this...
-
Aug 21st, 2000, 02:40 PM
#2
Monday Morning Lunatic
Have a look at the Clone method.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 21st, 2000, 03:16 PM
#3
Thread Starter
Addicted Member
looked at it... doesn't work for what I need...
thanx anyway.
-
Aug 21st, 2000, 04:15 PM
#4
I would use the INSERT INTO SQL statement with the SELECT option. Examples:
(1) For cases where the destination table has the same number of fields (and compatible datatypes) as the source table, you can use:
INSERT INTO DestinationTable SELECT * FROM SourceTable;
(2) For cases where the number of fields are different, or are in a different order, etc., you can use this variation:
INSERT INTO DestinationTable (DestField1, DestField2, etc.) SELECT SourceField3, SourceField4, etc. FROM SourceTable;
"It's cold gin time again ..."
Check out my website here.
-
Aug 22nd, 2000, 07:38 AM
#5
Thread Starter
Addicted Member
Thanx, I've been trying that, but my problem is one table is from a dbase database and the other table that I want to copy to is in a sql server database. Any ideas?
-
Aug 22nd, 2000, 08:55 AM
#6
Guru
Create a new recordset on the fly and populate it with your data. Then connect to SQL server, loop through the new recordset, and use SQL INSERT INTO statements.
-
Aug 22nd, 2000, 11:41 AM
#7
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|