473,395 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

column definitions

I've been searching for hours and hours and can't find what I need.

I'm creating a scripted web application that's designed to manage
multiple databases (MS SQL Server, MS Access, Oracle, PostgreSQL,
MySQL) using the same interface. I need to figure out how to create a
recordset that contains a list of all the column properties (column
name, data type, character length) for a specified table. The
MSysObjects table doesn't seem to contain any column information, and
I've seen several places where MS MVP's have said they don't think
Access exposes this information in a table like SQL Server
(syscolumns, information_schema.columns) or Oracle (all_tab_columns,
col). If there's a way to create a query, macro, etc. in Access that
will produce a recordset and be accessible by sql or there's a way to
access the information via COM either way will likely be enough for me
to do what I need, but I can't seem to find any clearly described or
succinct information about it.

Thanks,

Isaac

p.s. What is Type 3 in the MSysObjects table?
Nov 12 '05 #1
4 9651
Think Type 3 are subforms
"Isaac Dealey" <in**@turnkey.to> wrote in message
news:ad**************************@posting.google.c om...
I've been searching for hours and hours and can't find what I need.

I'm creating a scripted web application that's designed to manage
multiple databases (MS SQL Server, MS Access, Oracle, PostgreSQL,
MySQL) using the same interface. I need to figure out how to create a
recordset that contains a list of all the column properties (column
name, data type, character length) for a specified table. The
MSysObjects table doesn't seem to contain any column information, and
I've seen several places where MS MVP's have said they don't think
Access exposes this information in a table like SQL Server
(syscolumns, information_schema.columns) or Oracle (all_tab_columns,
col). If there's a way to create a query, macro, etc. in Access that
will produce a recordset and be accessible by sql or there's a way to
access the information via COM either way will likely be enough for me
to do what I need, but I can't seem to find any clearly described or
succinct information about it.

Thanks,

Isaac

p.s. What is Type 3 in the MSysObjects table?

Nov 12 '05 #2
rkc

"Isaac Dealey" <in**@turnkey.to> wrote in message
news:ad**************************@posting.google.c om...
I've been searching for hours and hours and can't find what I need.

I'm creating a scripted web application that's designed to manage
multiple databases (MS SQL Server, MS Access, Oracle, PostgreSQL,
MySQL) using the same interface. I need to figure out how to create a
recordset that contains a list of all the column properties (column
name, data type, character length) for a specified table.


The OpenShema method of the ADODB Connection object is most
likely what you are looking for.

Here's a short example I tested in the Northwind example database.
Obviously you'll have to do some more reading up on everything that's
involved with OpenSchema, but it should be a shove in the right
direction.

<Example Code>

Sub ShowColumnProperties(TableName As String)
Dim rs As ADODB.Recordset
Dim fld As ADODB.Field

Set rs = CurrentProject.Connection.OpenSchema _
(adSchemaColumns, Array(Empty, Empty, TableName))

' For Each fld In rs.Fields
' Debug.Print fld.Name
' Next

With rs
Do While Not .EOF
Debug.Print !COLUMN_NAME
Debug.Print " "; !DATA_TYPE
Debug.Print " "; !CHARACTER_MAXIMUM_LENGTH
Debug.Print " "; !Description
.MoveNext
Loop
End With

rs.Close
Set rs = Nothing
End Sub

</Example Code>
Nov 12 '05 #3
I think if you use ADO, you can query the DB schema and get all the
details you need - tablenames, field names, types, sizes, properties
and all that...
Nov 12 '05 #4
TC
Jet exposes table schemas via DAO objects. You could use those objects to
create a table with the relevant information, then open a recordset on that
table. Roundabout, but ...!

Something like this (untested):

dim db as database, td as tabledef, fld as field
set db=currentdb()
for each td in db.tabledefs
for each fld in td.fields
debug.print td.name, fld.name, fld.type
next
next
set db=nothing

Of course, that code just prints the details to the debug window. But you
could easily go from there, to saving them into a database table.

HTH,
TC
"Isaac Dealey" <in**@turnkey.to> wrote in message
news:ad**************************@posting.google.c om...
I've been searching for hours and hours and can't find what I need.

I'm creating a scripted web application that's designed to manage
multiple databases (MS SQL Server, MS Access, Oracle, PostgreSQL,
MySQL) using the same interface. I need to figure out how to create a
recordset that contains a list of all the column properties (column
name, data type, character length) for a specified table. The
MSysObjects table doesn't seem to contain any column information, and
I've seen several places where MS MVP's have said they don't think
Access exposes this information in a table like SQL Server
(syscolumns, information_schema.columns) or Oracle (all_tab_columns,
col). If there's a way to create a query, macro, etc. in Access that
will produce a recordset and be accessible by sql or there's a way to
access the information via COM either way will likely be enough for me
to do what I need, but I can't seem to find any clearly described or
succinct information about it.

Thanks,

Isaac

p.s. What is Type 3 in the MSysObjects table?

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Shino | last post by:
Hi, Can anyone help with this error: "ORA-00904: invalid column name"? Thanks! SQL> create view PPFa as 2 SELECT L.UserID AS LecID, U.Name, U.Email, I.IntakeID, S.UserID AS StudID 3 FROM...
6
by: Doug Baroter | last post by:
What is a good method/mechanism to swap the position of multiple columns? For instance, tblXZY has the followings columns and respective positions: tblXZY ====== xyzUUID 1 fn 2 ln 3...
7
by: CharlesEF | last post by:
Hi All, I have run into another problem that is eating my lunch. Should be simple but I am having one heck of a time. Please look at this SELECT statement: SELECT FROM States WHERE ] =...
4
by: UDBDBA | last post by:
Hi: we have column with GENERATED ALWAYS AS DEFAULT. So, we can insert into this column manually and also let db2 generate a value for this column. Given a scenario, how can i find the NEXTVAL...
2
by: Tim Newton | last post by:
Hi I have a vb app that uses an access database to store information. This app has been distributed to several users. I would like to increase the size of a field in an access table using my vb...
3
by: Joel Byrd | last post by:
I've got a 2-column tableless layout and I'm using floats to render the columns. Here are the basic style definitions for the 2 columns: #left_col { width: 59%; float: left; clear: left; }
5
by: Roger | last post by:
I am trying to do a 'simple' task in a DGV control. The problem is this. I have an unbound DGV with all 'AllowUser' options disabled. RowHeader.Visible=False ColumnHeader.Text is labelled as...
4
by: Hexman | last post by:
Hello All, I'd like to find out the best way to add a cb column to a dgv and process efficiently. I see at least two ways of doing it. ------------------------------- 1) Add a cb to the dgv,...
1
by: Neeraj | last post by:
Hi all. I have stuck at a strange point.in Database some master table have identity column and some havenot. Then How can i know at runtimes that which table have identity column. According to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.