views:

118

answers:

1

Hello,

I am trying to run a for loop for a backup system and inside that i want to run a SP that will loop. Below is the code that does not work for me..

Any ideas please?

Dim TotalTables As Integer
Dim i As Integer

TotalTables = 10
  For i = 1 To TotalTables
 objDL.BackupTables(220, i, 001) ' (This is a method from the DL and the 3 parameters are integars)
 Next

I tried the SP and it works perfectly in SQLServer

A: 

Third parameter is bad, should be:

objDL.BackupTables(220, i, 1)
Tim
yes thats not a problem...i am actually using other values. these were only for examplesdo you know what the actual issue might be?
Mo
If you give us your DL code - it might help. What exception it throws?
Tim
i did more debugging and i think the loop is not working because i have a dynamic SQL in my SP therefore it maybe cannot read it well. Any suggestions on how i can make the SP work pleasE?
Mo