and ADO recordset conversion

Results 1 to 2 of 2

Thread: and ADO recordset conversion

  1. #1
    Join Date
    Dec 1969

    Default and ADO recordset conversion

    Hi all, i am converting one of my pages in asp to, i am trying to use ado to connect to the database. However, when i do &#039;response.write("rsSet("column")")&#039; i get an error saying &#039;invalid cast from type field to type string&#039;. I tried enclosing rsSet in CStr, cstr(rsSet("column")) but got the same error, any one else have this problem? Code<BR><BR>rsSet = conn.Execute("Select * from trans order by trans_desc asc")<BR> Do While Not rsSet.EOF<BR> Response.Write("&#060;OPTION VALUE=" & CStr(rsSet(0)) & "&#062;" & Cstr(rsSet(1)) & "&#060;/OPTION&#062;")<BR> rsSet.MoveNext<BR> Loop

  2. #2
    Join Date
    Dec 1969

    Default RE: and ADO recordset conversion

    Any special reason why you are using ADO instead of ADO.NET(OleDb)? Anyway, try referencing the fields by name instead of ordinal, like this:<BR>rsSet.Fields("whateverField").value

Posting Permissions

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