Results 1 to 3 of 3

Thread: ADODB.Field vs Field (resolved)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    ADODB.Field vs Field (resolved)

    In vb6 i can use : a=objRS.Fields(1) ..etcf
    [Item(Index) As Field)]

    In vb.net :a=objRS.Field(1) ..is not allowed
    [Item (Index As object) As ADODB.Field)]

    however do i assign the value to a variable then....(the error says : type
    ADODB.Field cannot be converted to string)

    Thank You.
    Last edited by Goh; Apr 15th, 2004 at 11:53 PM.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    That's because in VB6, the Field object returned a default property of .Value.... in .NET you can't do that...
    You have to actually specify the .Value property otehrwise it tries to return the Field object (which causes your type mismatched)

    a=objRS.Field(1).Value

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908
    thanks!

Posting Permissions

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



Click Here to Expand Forum to Full Width