Results 1 to 10 of 10

Thread: Adodb , recordset types , attributes etc etc

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    Adodb , recordset types , attributes etc etc

    i am working on a way to get info from a database , when i get .type and .attributes it returns numbers , does anybody have a documentation of what they all mean? i got these types up to now

    2 Integer
    3 Long integer
    4 Single
    5 double
    6 currency
    7 Data/time
    11 Boolean
    17 Byte
    72 Replicant id
    131 Decimal
    202 Text
    203 Memo / Hyperlink
    205 Ole object

    but i have no ideas what the attributes are nor what it returns really.

    so how to check if a item is a PRIMARY KEY , or an autoincrement etc etc...
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Where are you getting these values from? Also why use the old ADODB instead of the ADO.NET provider? I think you can find an AutoIncrement field via ADOX.

  3. #3

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    i got the values from rs.type.... i made a db with all possible fields and checked them....

    well i am using Adodb that is included in vb.net refrences ..... :S.... i guess.....

    and how does adox work then?
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  4. #4

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    ok just found out that i am using the .net version of ADODB......


    but i still dont know how to get certain info like Primary key , auto increment etc etc
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    What object are you working with a DataSet? You can use the GetOLEDBScheme(I think thats it) method of an OLEDBConnection to get information about a table and so on. I'm not sure exactly everything it returns but you can throw it in a datagrid and find out.

  6. #6
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    You should be able to just pass the following query to the database and then bind it to a datagrid
    Code:
    SELECT * FROM Information_Schema.Columns WHERE TABLE_NAME = tableName
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  7. #7

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    i am using

    VB Code:
    1. Try
    2.             Dim i As ADODB.Field
    3.             If rs.State <> 0 Then rs.Close()
    4.             rs.Open("SELECT * FROM " & tables.Items.Item(tables.SelectedIndex), db)
    5.             For Each i In rs.Fields
    6.                 MsgBox(i.Name & vbCrLf & i.Type & vbCrLf & i.Attributes & vbCrLf & i.DefinedSize)
    7.                Next
    8.             rs.Close()

    where tables.Items.Item(tables.SelectedIndex) is the table that the user selected.

    will try your code Memnoch1207
    Last edited by Ultimasnake; Oct 28th, 2003 at 05:08 AM.
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  8. #8

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    Information_Schema.Columns ??? what should i do with that.. it tells me it cant find the file?
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  9. #9
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    what database are you using? The above is for a sql server database.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  10. #10

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    its an access db.....

    through adodb ....

    it uses SQL strings to open the database
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

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