Chris Hagwood wrote:
>Anyone with an idea for an automated way to copy all of one record from one
>table to another identical table (sort of a backup copy)?
>
>I've tried something like this, but it doesn't work:
>
>strSQL = "Select * from EVENTS WHERE inckey in (" & request("delete") & ")
>order by inckey;"
>rsMDB.Open strSQL, strCon
> Do While NOT rsMDB.EOF
> strSQL = "Select * from EVENTS;"
> rs.Open strSQL, strCon, 3, 2, &H0001
> rs.AddNew
> For i = 0 to rsMDB.Fields.Count - 1
> 'response.write rsMDB(i) & "<BR>"
> rs(i) = rsMDB(i)
> Next
> rs.Update
> rs.Close
> rsMDB.MoveNext
> Loop
> rsMDB.Requery
> rsMDB.Close
>
>It errors on the rs.Update statement with "error in row"
>
>
Well, if you want to do it that way, what's wrong with using an INSERT
SQL statement in the loop?
Otherwise, you can try something like
INSERT INTO Events_bckUp (SELECT * FROM Events WHERE inckey in (" &
request("delete") & "));
though I'm not certain that this will work. Anyone else used this, or am
I having some mad fake flashback? I'm sure I've used something like that.
manzo
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/