If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Insert Recordset Results

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-04, 11:48
just1joe just1joe is offline
Registered User
 
Join Date: Mar 2004
Location: Cambridge
Posts: 2
Insert Recordset Results

Hello,

This is probably a simple question, but I have not been able to find a solution in the forums.

I have an ASP page that returns the recordset results of a SQL Query.

I would like to be able to take the reults of the recordset and, based on user request, insert those results into another table. I could do this by using an insert statement and resubmitting the query, but then the select statment would have to run more than once. How do I insert the results of a query already completed?

- joe
Reply With Quote
  #2 (permalink)  
Old 03-11-04, 19:21
w1n78 w1n78 is offline
Registered User
 
Join Date: Mar 2004
Posts: 6
Lightbulb

while it displays the first query results, you can have it create an insert statement for every row it displays. You can then either assign it a button for each row to call the function with the insert statement(s) or have asp automatically run the insert as the page loads. post the code with the first query and i'll see if i can make it a little clearer
Reply With Quote
  #3 (permalink)  
Old 03-11-04, 19:54
just1joe just1joe is offline
Registered User
 
Join Date: Mar 2004
Location: Cambridge
Posts: 2
Talking

Thanks.

I ended up writing the records to a hidden field and passing them to another page for the insert.

- Joe http://www.dbforums.com/images/icons/icon10.gif
Reply With Quote
  #4 (permalink)  
Old 03-12-04, 01:33
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
<<
I could do this by using an insert statement and resubmitting the query, but then the select statment would have to run more than once.
>>

I'd probably just say so what and go for it (assuming not a high traffic site perhaps).
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On