|
-
Oct 27th, 2003, 04:31 AM
#1
Thread Starter
Frenzied Member
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...
-
Oct 27th, 2003, 05:02 AM
#2
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.
-
Oct 27th, 2003, 05:10 AM
#3
Thread Starter
Frenzied Member
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?
-
Oct 27th, 2003, 11:47 AM
#4
Thread Starter
Frenzied Member
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
-
Oct 27th, 2003, 01:26 PM
#5
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.
-
Oct 27th, 2003, 02:26 PM
#6
Frenzied Member
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
-
Oct 28th, 2003, 05:05 AM
#7
Thread Starter
Frenzied Member
i am using
VB Code:
Try
Dim i As ADODB.Field
If rs.State <> 0 Then rs.Close()
rs.Open("SELECT * FROM " & tables.Items.Item(tables.SelectedIndex), db)
For Each i In rs.Fields
MsgBox(i.Name & vbCrLf & i.Type & vbCrLf & i.Attributes & vbCrLf & i.DefinedSize)
Next
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.
-
Oct 28th, 2003, 05:11 AM
#8
Thread Starter
Frenzied Member
Information_Schema.Columns ??? what should i do with that.. it tells me it cant find the file?
-
Oct 28th, 2003, 08:59 AM
#9
Frenzied Member
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
-
Oct 28th, 2003, 09:07 AM
#10
Thread Starter
Frenzied Member
its an access db.....
through adodb ....
it uses SQL strings to open the database
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|