Table duplicates

craigbradshaw

New Member
Joined
Nov 26, 2002
Messages
39
I need to duplicate data from one table to another, I have created an ASP page that writes to a table, and deletes form that table, i want to create a second table that holds history, so when i write to table a, table b is automaticaly updated, but if a delete an item for tbl A it stays on tbl B
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Without seeing your ASP code it's hard to determine how to solve your problem. I don't think it would be possible to set your tables so this happens automatically so you'd need to take care of it in your update code. Can you post your code?
 
Upvote 0
this is the bit of code that ASPmaker produces the [special] is the tbl name, however there is a tbl called specialhistory, so i need to write to both tables, and let the other bit of ASP delete only from [special]

hope this makes sense.

'get fields from form

x_ID = Request.Form("x_ID")
x_Branch = Request.Form("x_Branch")
x_item = Request.Form("x_item")
x_date = Request.Form("x_date")
x_qty = Request.Form("x_qty")

' Open Connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str

Select Case a
Case "A": ' Add

' Open record
strsql = "SELECT * FROM [special] WHERE 0 = 1"

set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2

rs.AddNew


tmpFld = Trim(x_Branch)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Branch") = tmpFld
tmpFld = Trim(x_item)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("item") = tmpFld
tmpFld = Trim(x_date)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("date") = tmpFld
tmpFld = Trim(x_qty)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("qty") = tmpFld

rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Clear
Response.Redirect "speciallist.asp"
End Select
%>
 
Upvote 0

Forum statistics

Threads
1,221,494
Messages
6,160,141
Members
451,624
Latest member
TheWes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top