Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > add query result into table

Thread Tools Display Modes
Old 04-15-2004, 08:08 PM
cnsg cnsg is offline
Join Date: Feb 2004
Posts: 22
Default add query result into table

suppose rst is the recordset after query,i want to create a temporary table on server to store them for use in next procedure,how can i add the recordset into the table? thanks!
Reply With Quote
Old 04-16-2004, 02:16 AM
Shurik12 Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227

1) by looping through the 'source' recordset and execting "INSERT INTO ..." against the Connection or Command objects
2) by opening the second recordset (based on the target table), looping through
the 'source' recordset and using .AddNew method
3) by inlcuding the sql statement behind the 'source' recordset into the "INSERT INTO.." and executing it, meaning:
INSERT INTO Table1 (Field1, Field2) SELECT Field1, Field2 FROM Table2

"A diaper is not like a computer that makes satisfying burbling noises from time to time, hinting at great inner complexity." Malcolm Gladwell

"I'm sitting here completely surrounded by no beer." Onslow, 'Keeping up appearances'
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Result of SQL query in a textbox ? VBKid04 Database and Reporting 8 04-15-2004 06:29 AM
Result of SQL Query in textbox - 1st matching record is missing ? URGENT! VBKid04 Database and Reporting 1 04-14-2004 05:57 PM
How to generate a .xls file using a dbgird result or a sql query? Teixeira Excel 4 04-07-2004 09:45 AM
Make Table Query Updateable? Memnoch1207 Database and Reporting 1 05-02-2002 02:43 PM
How to compare an empty value in a query.. pragash Database and Reporting 1 10-22-2001 11:12 PM


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..