Getting Table Name from Field Properties 
Author Message
 Getting Table Name from Field Properties
Hi All,

Is there any way to determine the name of the underlying table that a field
belongs to, i.e. if I execute a query like "SELECT TableA.*, TableB.* FROM TableA
INNER JOIN TableB ON TableA.LinkField = TableB.LinkField" how do I find out which
Table the Field Recordset.Fields(1) comes from?

Cheers,
Gareth Thom



Fri, 23 May 2003 03:00:00 GMT
 Getting Table Name from Field Properties

The way should be

Recordset.Fields(1).Properties("BASETABLENAME")

(and other properties for base schema and base catalog).

But perhaps the value is empty (Null) if your provider doesnt fill the
value or the underlying native API for the database does not expose that
information.

--
Best regards,

Carlos J. Quintero

Freeware "all-in-one" Add-In for VB6: TabIndex Assistant, Procedure Callers,
Find in All Projects, Close Windows, Review TabIndex, Review Collections,
Add Property or Function, Add Error Handler, Add Header Comment, Clear
Immediate Window, Project Statistics:
www.mztools.com



Hi All,

Is there any way to determine the name of the underlying table that a field
belongs to, i.e. if I execute a query like "SELECT TableA.*, TableB.* FROM
TableA
INNER JOIN TableB ON TableA.LinkField = TableB.LinkField" how do I find out
which
Table the Field Recordset.Fields(1) comes from?

Cheers,
Gareth Thom



Sat, 24 May 2003 03:00:00 GMT
 Getting Table Name from Field Properties
Yes, I noticed that property, as well as BASECOLUMNNAME, but like you say they
are both empty.

Does anyone know any Database types that fill these properties in?

I'm currently using MS Access (provider = Microsoft.Jet.OLEDB.4.0) and that
obviously does not unless I'm doing something wrong, or need to do something
extra to get them.

If anyone has every used either of these properties please let me know.

Cheers,
G.

Quote:
-----Original Message-----

The way should be

Recordset.Fields(1).Properties("BASETABLENAME")

(and other properties for base schema and base catalog).

But perhaps the value is empty (Null) if your provider doesnt fill the
value or the underlying native API for the database does not expose that
information.

--
Best regards,

Carlos J. Quintero

Freeware "all-in-one" Add-In for VB6: TabIndex Assistant, Procedure Callers,
Find in All Projects, Close Windows, Review TabIndex, Review Collections,
Add Property or Function, Add Error Handler, Add Header Comment, Clear
Immediate Window, Project Statistics:
www.mztools.com



Hi All,

Is there any way to determine the name of the underlying table that a field
belongs to, i.e. if I execute a query like "SELECT TableA.*, TableB.* FROM
TableA
INNER JOIN TableB ON TableA.LinkField = TableB.LinkField" how do I find out
which
Table the Field Recordset.Fields(1) comes from?

Cheers,
Gareth Thom

.



Sat, 24 May 2003 03:00:00 GMT
 Getting Table Name from Field Properties

Quote:

> Yes, I noticed that property, as well as BASECOLUMNNAME, but like you say they
> are both empty.

> Does anyone know any Database types that fill these properties in?

> I'm currently using MS Access (provider = Microsoft.Jet.OLEDB.4.0) and that
> obviously does not unless I'm doing something wrong, or need to do something
> extra to get them.

> If anyone has every used either of these properties please let me know.

I tried to use it with MSDASQL (Microsoft OLE DB Provider for ODBC), but it didn't work either.
I'm very interested too.

Umberto



Mon, 26 May 2003 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. how could I get the source table name and field name from a view field

2. getting field name from field content

3. Getting table names without actually knowing their names...

4. Getting the caption property from a field object in VBA

5. How to Compare Tables, Fields, & Field Properties

6. MDX field name in ADO recordset filter property

7. Getting rid of the IDENTITY property on a column withou getting rid of the column

8. .Name property in fields

9. How to assign DataField property with a variable which store a field name

10. Rdb ODBC v3.0.1.1 and the fields(n).name property using ADO

11. MDX field name in ADO recordset filter property

12. Fields collection name property


 
Powered by phpBB® Forum Software