samantha72
Programmer
I have a sheridan grid where the user enters information and this has to be saved via a stored
procedure. Since the user can enter several rows of information, the grid has to be
looped to save information.
What I need to know is do I just have to loop through the grid and append each parameter
for eg
sstring = dbgrid.columns(0).text
snew = dbgrid.columns(1).text
for rowscount = 0 to dbgGrid.rows - 1 step 1
With cmdSave
.ActiveConnection = mcnnDB
.CommandText = "SaveOrders_pr"
.CommandType = adCmdStoredProc
.Parameters.Append cmdOrders.CreateParameter(, advarchar, adParamInput, 10, ssstring)
.Parameters.Append cmdOrders.CreateParameter(, advarchar, adParamInput, 15, snew)
End With
next irowscount
set rssave = cmdorders.execute
Will this work?
Thanks
procedure. Since the user can enter several rows of information, the grid has to be
looped to save information.
What I need to know is do I just have to loop through the grid and append each parameter
for eg
sstring = dbgrid.columns(0).text
snew = dbgrid.columns(1).text
for rowscount = 0 to dbgGrid.rows - 1 step 1
With cmdSave
.ActiveConnection = mcnnDB
.CommandText = "SaveOrders_pr"
.CommandType = adCmdStoredProc
.Parameters.Append cmdOrders.CreateParameter(, advarchar, adParamInput, 10, ssstring)
.Parameters.Append cmdOrders.CreateParameter(, advarchar, adParamInput, 15, snew)
End With
next irowscount
set rssave = cmdorders.execute
Will this work?
Thanks