Howto get the rousource property of an Ms Access table or the constraint column name

Howto get the rousource property of an Ms Access table or the constraint column name

am 23.01.2005 16:33:43 von Irena

Hi everyone there,


>From time to time, I go back to an ASP project of mine that drives me
nuts, now.


In an ASP script, I need 1) or to get the "ROWSOURCE" property of an Ms
Access table 2) or to get the constraint column of a foreign key (so to
say, if my table is Books in which a foreign key whose name is
Author_ID is present, I need to get the Author_Name column, the foreicn
key's displayed column).


I have been suggested to use DAO object insted of ADO to acces the Ms
Access database for getting the "ROWSOURCE" property of an Access
table.

So it should have worked like this:
....fldName.Properties("RowSource").

Unfortunately this property does not exist in DAO 3.6.

My source code:
set dbEng = Server.CreateObject("DAO.DBEngine.36")
set ws = dbEng.Workspaces(0)
set db = ws.OpenDatabase(DBPath)
set td = db.tabledefs(tblName)
for each fldName in td.Fields

response.write "


Field Name: "&fldName.Name
response.write "

Field Type: "&fldName.Type
response.write "
Field Size: "&fldName.Size
response.write "
Field AllowZeroLength: "&fldName.AllowZeroLength
response.write "
Field DefaultValue: "&fldName.DefaultValue
response.write "
Field Required: "&fldName.required
Next
....


The list of the existing properties of "Fields" is as follows:
Value =
Attributes =
CollatingOrder =
Type =
Name =
OrdinalPosition =
Size =
SourceField =
SourceTable =
ValidateOnSet =
DataUpdatable =
ForeignName =
DefaultValue =
ValidationRule =
ValidationText =
Required =
AllowZeroLength =
FieldSize =
OriginalValue =
VisibleValue =
ColumnWidth =
ColumnOrder =
ColumnHidden =


Do I do something wrong here? Is there anohter way to read this
property or at least the constraint column name of a foreign key?
Thanks a lot.

Regards,
Irena

Re: Howto get the rousource property of an Ms Access table or the constraint column name

am 23.01.2005 16:38:33 von reb01501

Irena wrote:
> Hi everyone there,
>
>
>> From time to time, I go back to an ASP project of mine that drives
>> me nuts, now.
>
>
> In an ASP script, I need 1) or to get the "ROWSOURCE" property of an
> Ms Access table 2) or to get the constraint column of a foreign key
> (so to say, if my table is Books in which a foreign key whose name is
> Author_ID is present, I need to get the Author_Name column, the
> foreicn key's displayed column).

http://msdn.microsoft.com/library/en-us/ado270/htm/admscadod dloverview.asp
http://msdn.microsoft.com/library/en-us/ado270/htm/admscadoa pireference.asp
http://www.aspfaq.com/search.asp?q=ADOX&type=ALL&category=0& numDays=0&order=1

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Howto get the rousource property of an Ms Access table or the constraint column name

am 23.01.2005 16:50:04 von Irena

Bob Barrows [MVP] wrote:
> Irena wrote:

> > In an ASP script, I need 1) or to get the "ROWSOURCE" property of
an
> > Ms Access table 2) or to get the constraint column of a foreign key
> > (so to say, if my table is Books in which a foreign key whose name
is
> > Author_ID is present, I need to get the Author_Name column, the
> > foreicn key's displayed column).
>
>
http://msdn.microsoft.com/library/en-us/ado270/htm/admscadod dloverview.asp
>
http://msdn.microsoft.com/library/en-us/ado270/htm/admscadoa pireference.asp
>
http://www.aspfaq.com/search.asp?q=ADOX&type=ALL&category=0& numDays=0&order=1
>
> Bob Barrows

Hi Bob,

thanks for your prompt reply, however - in ADOX - none of the two
properties (rowsource and constraint_column) is available for reading.
Already checked.

Cheers,
Irena

Re: Howto get the rousource property of an Ms Access table or the constraint column name

am 23.01.2005 17:37:41 von reb01501

Irena wrote:
>
> thanks for your prompt reply, however - in ADOX - none of the two
> properties (rowsource and

Rowsource? Of a table?? What is that? And how do you intend to utilize that
property in ASP? If it's what I think it is, then it is only usable within
Access itself.

The Jet provider does provide access to certain Jet-provided properties.
Many of the properties provided by Access are not available. If the property
you want is not listed here:

http://msdn.microsoft.com/library/en-us/ado270/htm/mdrefjetp rovspec.asp
or here:
http://msdn.microsoft.com/library/en-us/oledb/htm/oledbprovj et_provider_defined_properties_in_dbpropset_jetoledb_table.a sp
or here:
http://msdn.microsoft.com/library/en-us/oledb/htm/oledbprovj et_provider_specific_properties_in_dbpropset_jetoledb_column .asp

then it is simply not available to ASP. For the most part, those properties
that are only useful in Access forms and datasheets are not exposed to
external applications.

> constraint_column) is available for reading. Already checked.

You missed this one:
http://www.aspfaq.com/show.asp?id=2520

Do not think about using DAO in ASP if you don't want to bog down your
server. DAO is single-threaded and its use will impair your server's
performance. it was intended for use in desktop applications.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Howto get the rousource property of an Ms Access table or the constraint column name

am 23.01.2005 18:32:48 von Irena

Bob Barrows [MVP] wrote:
> then it is simply not available to ASP. For the most part, those
properties
> that are only useful in Access forms and datasheets are not exposed
to
> external applications.

That's what I suspected.

>
> > constraint_column) is available for reading. Already checked.
>
> You missed this one:
> http://www.aspfaq.com/show.asp?id=2520
>

The MySysRelationships in Access does not expose the constraint column.
Have you ever checked with a "SELECT * FROM MySysRelationships"?

> Do not think about using DAO in ASP if you don't want to bog down
your
> server. DAO is single-threaded and its use will impair your server's
> performance. it was intended for use in desktop applications.

I know, but I was thinking I could have reached my goal with it, but it
is not the case.

Thanks
Irena