Results 1 to 5 of 5

Thread: [RESOLVED] ADO in Visual 2005

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Resolved [RESOLVED] ADO in Visual 2005

    Hi guys,

    Been reading some stuff here on ADO.NET i have an limited understanding of ADO in VB6 and i am trying to work out the presence of Index integars rather than table and row & column names i find this confusing how do i see what index relates to what table,row or column? and can i not just refer to them by name?

    Thanks in advance.

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: ADO in Visual 2005

    Wow - that was totally confusing...

    INDEX's are simply objects in the database.

    Are you saying you want to find out the names of the index objects in your database?

    And that you want to find out what tables and columns they relate to?

    What is your backend database?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Re: ADO in Visual 2005

    He He here is what i am refering to

    Code:
    If ds.Tables(0).Rows.Count > 0 Then 'Check if the table is empty
                      txtFirstName.Text = ds.Tables(0).Rows(0).Item("FirstName").ToString()
                      txtLastName.Text = ds.Tables(0).Rows(0).Item("LastName").ToString()
                      txtLocation.Text = ds.Tables(0).Rows(0).Item("Location").ToString()
    End If
    Anyway i have never seen this in vb6 with ado. Although i never had a next record facility in my db App before i allways searched for records.

    Thanks. is an Access 2000 db btw

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: ADO in Visual 2005

    In short, yes.... the variable ds is a DataSet. A DataSet can contain one (or none if it's empty) or more DataTables. When the datatable is created, you have the option to give it a name. If you don't it gets a default name (not sure what it is, but probably along the lines of TableX where X is a number in sequence.) So, for teh tables part, yes you can refer to it by number or by name. Each DataTable is then made up of DataRows... now, rows are jsut that, rows ... so there isn't a way to refer to them by name, only by index. Where 0 is the first row, 1 is the second, etc. Item is the column... again, like tables, you can refer to them by name or by index.

    You might want to peruse the database FAQ here, it's got several tutorials and links to help you get started.

    -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??? *

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Re: ADO in Visual 2005

    Thanks i did look at all the stuff here hence this question because it isn't refered to in any of the ones i looked at and it is a big difference to vb6 -ado.
    i can now see the index as i posted previous its not some thing ill use as ill be searching my db rather than keying forward or back and linking my tables by the same field containign the key word(telephone number) thanks again i am sure ill be back so thanks in advance

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