respose.write error

Results 1 to 4 of 4

Thread: respose.write error

  1. #1
    Rolly Guest

    Default respose.write error

    Something ain&#039t working very well. Error is mentioned at the bottom of this message.<BR><BR>&#060;%<BR> <BR> place = Request.Form("place")<BR> <BR> Set Connection = Server.CreateObject("ADODB.Connection") <BR> Connection.Open "driver={Microsoft Access Driver (*.mdb)};dbq= c:Inetpubwwwvirtualeastjava_privateposition.mdb"<B R> sSQL = "select * from position where place=&#039" & place & "&#039"<BR> <BR>Set rs = Connection.Execute (sSQL)<BR><BR>&#039Check to see whether there are any records that matched and if there <BR>&#039are display the results.<BR><BR>If Not rs.EOF Then<BR> response.write "&#060;table&#062;"<BR> Do Until rs.EOF<BR> response.write "&#060;tr&#062;"<BR> For i = 0 to (rs.Fields - 1)<BR> response.write "&#060;td&#062;" & rs(i) & "&#060;/td&#062;"<BR> Next<BR> response.write "&#060;/tr&#062;"<BR> rs.MoveNext<BR> Loop<BR> response.write "&#060;/table&#062;"<BR>Else<BR> response.write "No Matching Records"<BR>Connection.Close <BR>End If<BR>%&#062;<BR><BR>I keep getting :<BR><BR> Microsoft VBScript runtime error &#039 800a01c2&#039 <BR>Wrong number of arguments or invalid property assignment <BR><BR>/viewpos.asp, line 28<BR><BR>Line 28 starts with :<BR>response.write "&#060;tr&#062;"<BR><BR>Thanks for all the help I can get.

  2. #2
    John Weeflaar Guest

    Default RE: respose.write error

    I think you need to position the record pointer to the first<BR>record before looping.<BR><BR>rs.MoveFirst &#039 try to add this<BR>Do Until rs.EOF<BR>response.write "&#060;tr&#062;"<BR><BR>Hope it works.<BR><BR>John

  3. #3
    John Weeflaar Guest

    Default RE: respose.write error

    Rolly, It&#039s actually in the next line where the error happens:<BR><BR>response.write "&#060;tr&#062;"<BR>For i = 0 to (rs.Fields - 1) &#039 here<BR><BR>Replace rs.Fields with rs.Fields.Count:<BR><BR>For i = 0 to (rs.Fields.Count - 1)<BR><BR>It should work now.<BR><BR>John <BR>

  4. #4
    Rolly Guest

    Default RE: respose.write error

    Dear Mr. John,<BR>Thank you very for using your valuable time helping me out.<BR>Best regards<BR>Rolly<BR>


Posting Permissions

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