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!

parameters to stored procedures

Status
Not open for further replies.

samantha72

Programmer
Jul 31, 2001
14
0
0
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top