[AccessD] determining the datatype of a bound control

Jim Lawrence (AccessD) accessd at shaw.ca
Thu Mar 25 01:42:29 CST 2004


Hi John:

There is no Me.RecordsetClone in ADO, simply because it is not 'bound' to
the form. The relationship between the form and recordset has to be created.

A FieldSource collection would have to be manually assembled...I think it is
no more difficult (difficult is relative, but when considered it in the
context with the framework...) than when the data source elements are being
attached to a 'bound' form's fields and maybe an semi-automated process
could be created(?).

If you require the properties, types, columns, relationships etc. from
tables, groups, users, procedures and even views, the ADOX object should be
used. I understand it was not fully implemented in SQL 7 but in SQL 2000 or
greater or in the current flavours of DAO, it is suppose to be...Have not
tested it as it was never an issue or that there was not a Framework to
satisfy.

When having ADO questions I refer to my ADO bible; 'Professional ADO 2.5
Programming' from WROX.

ADO is a big subject and there seems to be many ways to accomplish anything
and a lot of it's feature can be used in unconventional methods and
situations. After five years I am still just learning.

HTH
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John W. Colby
Sent: Tuesday, March 23, 2004 12:08 PM
To: AccessD
Subject: [AccessD] determining the datatype of a bound control


I currently determine the data type of the data that a control is displaying
by the following code:

Dim strCtlSrc As String
Dim rst As DAO.Recordset
Dim intType As Integer
    strCtlSrc = txtDOB.ControlSource
    Set rst = Me.RecordsetClone
    intType = rst.Fields(strCtlSrc).Type

Is there a similar method of getting at this from ADO?

John W. Colby
www.ColbyConsulting.com


--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list