Urgent !...

Results 1 to 3 of 3

Thread: Urgent !...

  1. #1
    Dina Mohan Guest

    Default Urgent !...

    &nbsp;<BR>hi,<BR><BR>i am using command object to insert values in to database. But getting an error .....<BR>My code<BR><BR> txtValues = Request("txtValues") <BR> tempSplit = split(txtValues,vbCrLf)<BR> Count = UBound(tempSplit)<BR> set Cmd1 = server.CreateObject("ADODB.COMMAND")<BR> set Cmd1.ActiveConnection = cn<BR> for i=0 to Count-1 <BR> Set prmtxtValues = Cmd1.CreateParameter("prmtxtValues",200,1,len(temp Split(i)),tempSplit(i))<BR> Cmd1.Parameters.Append prmtxtValues <BR> valSQL = "execute sp_insSurveyQuesValue " & SurveyQID & ",?" <BR> Cmd1.CommandText = valSQL <BR> Cmd1.Execute SQL <BR> valSQL =""<BR> next<BR><BR>it executes Cmd1.Execute SQL once. Next time showing an error that ...<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e21&#039 <BR><BR>Errors occurred <BR><BR>/NewResearch/Survey/inc_newSurvey.asp, line 50 <BR><BR>what&#039s wrong here please help me. it is urgent for me.<BR><BR>bye Dina.

  2. #2
    Join Date
    Dec 1969

    Default RE: Urgent !...

    i think you have to use "," as the seperator in the Split function, if i understood correctly

  3. #3
    Join Date
    Dec 1969

    Default RE: Urgent !...

    I agree, but why not just access it like this: <BR><BR>if Request("txtValue").Count &#062; 1 then<BR> &#039 Do the loop.<BR>else<BR> &#039 Do only one.<BR>end if<BR><BR>Better yet, write a function that returns a collection of values in a Scripting.Dictionary object, and generically loop over that.<BR><BR>I&#039d worry about URL encoding and commas in the data when accessing Request as you do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts