I need to update a table from another table..
The two databases are paradox format DBFIII.
I have figured out a way to get around them not being in the same database by linking them in a MS Access database.
I need to grab data from one depending on a condition and insert them into the other. Right now I have to do a 5 minute procedure to do this by hand and I figured I could do it with asp much easier with one click or page load.
So I looked around and found something similar to the code below and rearrageged it to match my needs.
But I don't think it's going to work (I don't have access to the sever for a few days)
Can someone tell me if there is anything wrong with this code? and if it needs something else?
Should I use 2 recordsets here?
CODE BELOW:
<%
Dim ConnectString, conn, SQL
ConnectString = "Provider=Microsoft.Jet.OL
EDB.4.0;Da
ta Source=" & "c:\websites\mydata.mdb"
Set conn = Server.CreateObject("ADODB
.Connectio
n")
conn.open ConnectString
%>
<%
SQL = "SELECT * FROM mydata WHERE ACCO = '1000'"
Set RS = Conn.Execute(SQL)
while not RS.EOF
strACCO = RS("ACCO")
strDISCOUNT = RS("DISCOUNT")
strDUEON = RS("DUEON")
strGROSS = RS("GROSS")
strDATE = RS("DATE")
strINVOICE = RS("INVOICE")
strNET = RS("NET")
strVENDORINV = RS("VENDORINV")
strVENDORNAME = RS("VENDORNAME")
strEZPAY = RS("EZPAY")
strEZPAYNET = RS("EZPAYNET")
strAT = RS("AT")
strRECEIPT = RS("RECEIPT")
strBDATE = RS("BDATE")
SQL = "INSERT INTO mydata2(ACCO,DISCOUNT,GROS
S,DATE,INV
OICE,NET,V
ENDORINV,V
ENDORNAME,
EZPAY, "
SQL = SQL & "EZPAYNET,AT,RECEIPT,BDATE
) "
SQL = SQL & "VALUES('"& strACCO &"','"& strDISCOUNT &"','"& strGROSS &"','"& strDATE &"', "
SQL = SQL & "'"& strINVOICE &"','"& strNET &"','"& strVENDORINV &"','"& strVENDORNAME &"','"& strEZPAY &"', "
SQL = SQL & ""& strEZPAYNET &",'"& strAT &"','"& strRECEIPT &"','"& strBDATE &"','" & "')"
Conn.Execute(SQL)
RS.movenext
wend
RS.close
set RS = nothing
set conn = nothing
set ConnectString = nothing
%>