Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I accelarate my Database-Update ?

Status
Not open for further replies.

Paulus

Programmer
Sep 25, 2000
16
0
0
A1
I have an Acess 97 Recordset and want to update it from an AS/400-Recordset and it takes 24 hours !!! with an ado-connection. Do you know how to accelerate the process without using stored procedures ?
 
Do you know where the slow bit is. From as400 or to access.
How much data are you updating? Peter Meachem
peter@accuflight.com
 
I don´t know which one is slow.
I try to update 4400 records
 
Thats ridiculous. I thought you were going to say 44,000,000. Are you doing a lot of calculations? How are you doing the update?
Peter Meachem
peter@accuflight.com
 
I open both recordsets as commands from the Dataenvironment, the Access-RS as readonly, the AS/400-RS as read and write. Then move to the first record in the Access-RS, and ... (de=Dataenvironment)

with de.rsAccess
while not.eof
de.rsAS400.addnew
de.rsAS400.fields("test").value = .fields("test").value
de.rsAS400.update
wend
.close
end with
de.rsAS400.close

But, what´s wrong and why is it so slow ?
 
Have you tried using a command object that has an INSERT INTO statement in it and uses parameters to pass the values?

I am not sure if that will help but it may be worth a try

i.e. your command object's sql is

INSERT INTO rsAS400table (TEST)
VALUES (prmTEST)

and your code goes something like this
Code:
with de.rsAccess
  while not.eof
    de.rsAS400.Parameters("prmTEST") = .fields("test").value
    de.rsAS400
  wend
  .close
end with

maybe worth a try
Scott Hope
shope@gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top