more getting data from recordset problem? :{

Results 1 to 2 of 2

Thread: more getting data from recordset problem? :{

  1. #1
    Join Date
    Dec 1969

    Default more getting data from recordset problem? :{

    Hi. I have the iMoveId from my previous asp form. I want to query the fields from the table called "MoveInfo" where it is that iMoveId. Then send this out in email. On my "MoveInfo" table, I have the fields "FirstName", "Last Name". <BR>However, I keot getting the error: ADODB.Recordset error &#039;800a0cc1&#039; <BR>Item cannot be found in the collection corresponding to the requested name or ordinal. <BR>The error is pointing to the part on my Autoemail where I tried to sent out all the First and Last Name info. <BR><BR>My code is as follow: <BR>iMoveId = Request.form("iMoveId")<BR>Response.Write "&#060;B&#062;Move Id:&#060;/B&#062;" &iMoveId & "<BR>"<BR><BR>Set objConn = Server.CreateObject ("ADODB.Connection")<BR>objConn.Open "DSN=EmployeeMove; UID=sa; PWD=;"<BR>Set RS = Server.CreateObject("ADODB.RecordSet")<BR>strSQLIn fo = "SELECT * FROM MoveInfo WHERE MoveId=" &iMoveId<BR>RS.Open strSQLInfo, objConn<BR><BR>Set objCDOMail = Server.CreateObject("CDONTS.NewMail")<BR>objCDOMai l.From = "MoveRequest"<BR>objCDOMail.To= " "<BR>objCDOMail.Subject = "Move Request - Disapproved"<BR>strBody = " The Move Request has been denied." & vbCrLf & vbCrLf & _<BR>"Id No.: "&iMoveId&" " & vbCrLf & _ <BR>"First Name: "&RS(FirstName)&" " & vbCrLf & _<BR>"Last Name: "&RS(LastName)&" "<BR><BR>objCDOMail.Body = strBody<BR>objCDOMail.Send<BR>Set objCDOMail = Nothing<BR><BR>RS.Close<BR>Set RS=Nothing<BR>objConn.Close<BR>Set objConn = Nothing<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: more getting data from recordset problem? :{

    Look at where you are refenencing the fileds in your recordset.<BR><BR>This <BR><BR>RS(FirstName)<BR><BR>should be<BR><BR>RS("FirstName")<BR><BR>Obviously you are going to want to change that for your other fields as well.<BR><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