473,396 Members | 1,852 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,396 software developers and data experts.

Retrieving table field properties

hi can n e 1 tell me if there's a way to get the column properties from a
table?
properties like caption, description etc

thank you
Jul 19 '05 #1
8 2534
What kind of database?

Ray at work

"hytga" <St*******@to.me> wrote in message
news:wp*********************@bgtnsc05-news.ops.worldnet.att.net...
hi can n e 1 tell me if there's a way to get the column properties from a
table?
properties like caption, description etc

thank you

Jul 19 '05 #2
look here perhaps for an idea
http://www.darkfalz.com/1065

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"hytga" <St*******@to.me> wrote in message
news:wp*********************@bgtnsc05-news.ops.worldnet.att.net...
hi can n e 1 tell me if there's a way to get the column properties from a
table?
properties like caption, description etc

thank you

Jul 19 '05 #3
What kind of database?

MS Access
Jul 19 '05 #4
look here perhaps for an idea
http://www.darkfalz.com/1065


well it comes close to what i need. here's what i've been trying to do
but the below code gives error

Error Type:
ADODB.Properties (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name
or ordinal.


<!-- connection is already open ud_conn-->

' retrieve fields
set rsMyAcct=Server.CreateObject("ADODB.Recordset")
strSQL="SELECT * FROM [Users] WHERE Usr_ID='" & UCASE(userid) & "'"
rsMyAcct.Open strSQL , ud_Conn

Set rsProp = Server.CreateObject("ADOX.Catalog")
rsProp.ActiveConnection = ud_conn

if not rsMyAcct.eof then
For each Field in rsMyAcct.Fields

THIS IS THE ERROR LINE>>>>>>> response.write
rsProp.Tables("Users").Columns(Field.Name).Propert ies("Description").Value
& "<br>"

next
end if
Set rsProp= nothing
rsMyAcct.Close
Set rsMyAcct = Nothing

-----------------
n e ideas?
Jul 19 '05 #5
hytga wrote:
hi can n e 1 tell me if there's a way to get the column properties
from a table?
properties like caption, description etc

thank you


You will not be able to get at all of these properties via ADO. Caption and
Description are Access-defined properties. Description is exposed by the Jet
OLEDB provider; Caption is not. You need to keep in mind that Access is not
the database: Jet is the database. Access is a front-end tool for working
with Jet databases. One of the things Access to make it easier for users is
add properties to the database that Jet does not provide. Some of these
properties are exposed by the Jet OLEDB provider, and some are not.

Most of the other column properties can be read using ADOX, which is
installed with ADO. See here for a start:
http://www.aspfaq.com/show.asp?id=2244

See here for the Jet database properties that can be read using ADOX:
http://msdn.microsoft.com/library/en...etprovspec.asp

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #6
Saw your other post, It's for SQL, not Access.
Sorry.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"hytga" <St*******@to.me> wrote in message
news:v9******************@bgtnsc04-news.ops.worldnet.att.net...
look here perhaps for an idea
http://www.darkfalz.com/1065


well it comes close to what i need. here's what i've been trying to do
but the below code gives error

Error Type:
ADODB.Properties (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name
or ordinal.


<!-- connection is already open ud_conn-->

' retrieve fields
set rsMyAcct=Server.CreateObject("ADODB.Recordset")
strSQL="SELECT * FROM [Users] WHERE Usr_ID='" & UCASE(userid) & "'"
rsMyAcct.Open strSQL , ud_Conn

Set rsProp = Server.CreateObject("ADOX.Catalog")
rsProp.ActiveConnection = ud_conn

if not rsMyAcct.eof then
For each Field in rsMyAcct.Fields

THIS IS THE ERROR LINE>>>>>>> response.write
rsProp.Tables("Users").Columns(Field.Name).Propert ies("Description").Value
& "<br>"

next
end if
Set rsProp= nothing
rsMyAcct.Close
Set rsMyAcct = Nothing

-----------------
n e ideas?

Jul 19 '05 #7

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
hytga wrote:
hi can n e 1 tell me if there's a way to get the column properties
from a table?
properties like caption, description etc

thank you
You will not be able to get at all of these properties via ADO. Caption

and Description are Access-defined properties. Description is exposed by the Jet OLEDB provider; Caption is not. You need to keep in mind that Access is not the database: Jet is the database. Access is a front-end tool for working
with Jet databases. One of the things Access to make it easier for users is add properties to the database that Jet does not provide. Some of these
properties are exposed by the Jet OLEDB provider, and some are not.

Most of the other column properties can be read using ADOX, which is
installed with ADO. See here for a start:
http://www.aspfaq.com/show.asp?id=2244

See here for the Jet database properties that can be read using ADOX:
http://msdn.microsoft.com/library/en...etprovspec.asp

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #8
Thank you i'll give it a try
Jul 19 '05 #9

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

Similar topics

8
by: Vladimir | last post by:
Hello, I have a table in MS Access database. It has one field (with BYTE datatype) that has several properties set in Lookup tab of table Design View. Display Control = Combo Box. Row Source...
3
by: sparks | last post by:
I was copying fields from one table to another. IF the var name starts with milk I change it to egg and create it in the destination table. It works fine but I want to copy the description as...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
6
by: Kevin Chambers | last post by:
Hi all-- In an attempt to commit an Access MDB to a versioning system (subversion), I'm trying to figure out how to convert a jet table's metadata to text, a la SaveAsText. The end goal is to...
2
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What...
1
by: Olaf Rabbachin | last post by:
Hi folks, I'm looking for a way of retrieving the default-value of a table's field within an Access 2003 MDB. Any hints on how to accomplish this from ASP.Net? Thanks, Olaf -- My .02:...
4
by: Bob | last post by:
Hi all, I write the description of a lot of my tables and queries in the description section in the properties (when you right click on the table or query). Is there a method or a property that...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
9
ADezii
by: ADezii | last post by:
One question which pops up frequently here at TheScripts is: 'How do I retrieve data from a Recordset once I've created it?' One very efficient, and not that often used approach, is the GetRows()...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.