This should be a really simple thing to do, but it isn't working.
I want to determine all the column names in a table or at least all column names with a primary key. I attempted to do this OpenRecordset("desc " & tablename & ";", dbOpenSnapShot) but I get an error. (My tablename is a linked table to an Oracle table.) I'm using Oracle 10g. When I open TOAD and type desc tablename; I get a pop-up window describing the table instead of a record set with table names in it.
I thought about just saying select * from tablename; and then for each field in rs.Fields reading the field.Name. This worked great, until I came across an empty table. Nothing is returned from select * in that case! So then I thought well I could insert a row just before the query and then delete it again, but I can't even do this, because I don't know what the primary keys are on the table!
Basically if I could just do a desc or describe on the table in code, I would be fine, but I have not been able to figure out how to do this.
Please help...
Thanks.
I want to determine all the column names in a table or at least all column names with a primary key. I attempted to do this OpenRecordset("desc " & tablename & ";", dbOpenSnapShot) but I get an error. (My tablename is a linked table to an Oracle table.) I'm using Oracle 10g. When I open TOAD and type desc tablename; I get a pop-up window describing the table instead of a record set with table names in it.
I thought about just saying select * from tablename; and then for each field in rs.Fields reading the field.Name. This worked great, until I came across an empty table. Nothing is returned from select * in that case! So then I thought well I could insert a row just before the query and then delete it again, but I can't even do this, because I don't know what the primary keys are on the table!
Basically if I could just do a desc or describe on the table in code, I would be fine, but I have not been able to figure out how to do this.
Please help...
Thanks.