Problem with ADO connection 
Author Message
 Problem with ADO connection

Hi all,

I use DAO to connect the SQL server via ODBC connection.  To get a list of the
Field Names for each table in the database, I use the following codes:

        For Each td in db.TableDefs
                lstTables.AddItem td.Name
        Next

And also, to get all the fileds of a table, I have the following codes:

        dim fld as Field
        dim NewItem as ListItem

        strTableName = txtName.text

        For Each fld in db.TableDefs(strTableName).Fields
        strName = fld.Name
        set NewItem = lvwFields.ListItems.Add (, strName, strName)
        With NewItem
                newItem.SubItems(1) = fld.Type
        End With
        Next fld

Now, i am using ADO to connect the SQL server, how do I modify my codes?  there
is not much information for ADO in the reference book.

The code "For Each td In cn.OpenSchema(adSchemaTables).Fields" sounds very
reasonable to me, but it still doesn't work.  I don't know what my error is.  I
really approciate if someone could help em on this.  thanks.



Mon, 04 Jun 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB6: Problem sharing ADO connection between COM Objects (complex problem)

2. Problem sharing ADO connection between COM Objects (complex problem)

3. VB6: Problem sharing ADO connection between COM Objects (complex problem)

4. Problem sharing ADO connection between COM Objects (complex problem)

5. Problem with ADO connections

6. Problem with ADO connection

7. Problem with ADO connection

8. Problems with ADO connection

9. Problem opening ADO connection to database on a CDROM

10. Problem with ADO connection

11. I have a problem with ADO connection

12. Problem with ADO connection

 

 
Powered by phpBB® Forum Software