celtic5544
12-02-2003, 10:11 AM
I have a question, how would I go about moving information from one database to another? I have a tblMain database in access, and we want to give the option for someone to archive records, so I have a tblHistory for that.
So basically I need to know how to move something from tblMain to tblHistory while deleting it from tblMain.
zachzach
12-30-2003, 01:58 PM
oo....
javascript has a sucky interface for doing database
learn asp or php, they have great interfaces for databases
======================================
vbscript also can do it(thats what asp uses), but its not as interactive and fast
to establish a vbscript connection to a database, use this script:(this is for access databases, i dont know about others...ODBC)
<object id=rs classid="clsid:00000535-0000-0010-8000-00AA006D2EA4"></object>
<script language="VBScript">
connect = "data source=datasourcename;user id=userid;password=password;"
query = "Your SQL query"
rs.Open query, connect, 3, 3
set flds = rs.Fields
</script>
you are atomaticly accessing the first row of fieds.to view the first rows 1st(or any other number, just replace iioo with the number) collum information, use this:
flds(iioo)
and to move to the next/previous/last/first row, use your choice of one of these:
rs.MoveNext
rs.MovePrevious
rs.MoveFirst
rs.MoveLast
you can do things with rs.BOF and rs.EOF(End of file/Begining of file) like:
if not rs.BOF then
rs.MovePrevious
end if
because otherwise it would produce an error
hope that helps