|
-
Apr 27th, 2005, 09:17 AM
#1
Thread Starter
Hyperactive Member
get database information
Hi guys
A long shot, maybe, but is there any way that I can get details of all of the tables in a database by running a query?
The problem is this: I use an informix database hosted by a third party. They're happy for me to access however they're not very forthcoming with any sort of database design information so I don't know which columns are in which tables.
I know that if it were a sqlserver database I could run sp_help to get this sort of information however is there any query I can run in asp or vb that will give me this information?
ps, I've connected using ado.
Tar!
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
Apr 27th, 2005, 10:19 AM
#2
Re: get database information
You could loop through all the tables using Adox (if they've installed it) and output to the screen. Then loop through the columns on each table (listing under the table name?).
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 27th, 2005, 10:53 AM
#3
Thread Starter
Hyperactive Member
Re: get database information
Er, ok.....how do I go about this?!
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
Apr 27th, 2005, 11:21 AM
#4
Frenzied Member
Re: get database information
This article might help.
As far as ADOX goes, you'll need a reference to msadox.dll (Microsoft ADO Ext. 2.8 for DDL and Security) and you can get all sorts of schema info.
However, ADOX was designed and built for Access, so other DBMS are patchily supported. There are loads of posts in this forum about how best to use it.
-
Apr 28th, 2005, 03:27 AM
#5
Re: get database information
thebloke,
Open the database using ADO and try this:
VB Code:
Dim dbSchema as ADODB.Recordset
Dim i as Integer
Set dbSchema = New ADODB.Recordset
dbSchema = db.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "TABLE"))
For i = 0 to dbSchema.Fields.Count - 1
Debug.Print dbSchema.Fields(i)
Next i
Enumerate through the fields property for the names of the columns.
Last edited by randem; Apr 28th, 2005 at 03:42 AM.
-
Apr 28th, 2005, 06:54 AM
#6
Thread Starter
Hyperactive Member
Re: get database information
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
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
|