Skip to Content
0
Former Member
Oct 18, 2005 at 08:59 AM

Slow saving matrix data to a table

72 Views

Hi

I have a matrix which has dbdatasources and is linked to a user defined table. When I click on the ok button to save the contents of the matrix to the table it takes about 20 seconds to save it. There could be 30 columns and at the moment about 44 rows

Can anyone please suggest how I could speed it up please ?

Regards Andy

For lc = 0 To oform.DataSources.DBDataSources(0).Size - 1
   
   glcode = oform.DataSources.DBDataSources(0).GetValue("u_contrno", lc)
   gldesc = oform.DataSources.DBDataSources(0).GetValue("u_contrde", lc)
      
  For days = 1 To nodays
   h(days) = oform.DataSources.DBDataSources(0).GetValue("u_d" & Trim(Str(days)), lc)
  Next days
  strsql = "update [@tsr] set u_d1 = '" & h(1) & "',u_d2 = '" & h(2) & "',u_d3 = '" & h(3) & "',u_d4 = '" & h(4) & "',u_d5 = '" & h(5) & "',u_d6 = '" & h(6) & "',u_d7 = '" & h(7) & "',u_d8 = '" & h(8) & "',u_d9 = '" & h(9) & "',u_d10 = '" & h(10) & "',u_d11 = '" & h(11) & "',u_d12 = '" & h(12) & "',u_d13 = '" & h(13) & "',u_d14 = '" & h(14) & "',u_d15 = '" & h(15) & "',u_d16 = '" & h(16) & "',u_d17 = '" & h(17) & "',u_d18 = '" & h(18) & "',u_d19 = '" & h(19) & "',u_d20 = '" & h(20) & "',u_d21 = '" & h(21) & "',u_d22 = '" & h(22) & "',u_d23 = '" & h(23) & "',u_d24 = '" & h(24) & "',u_d25 = '" & h(25) & "',u_d26 = '" & h(26) & "',u_d27 = '" & h(27) & "',u_d28 = '" & h(28) & "',u_d29 = '" & h(29) & "',u_d30 = '" & h(30) & "',u_d31 = '" & h(31) & "' where u_ts = '" & ts & "' and u_contrno = '" & glcode & "'"

  orecset.DoQuery (strsql)
Next lc