Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Ambiguous columns with recordsets


Message #1 by rmz@m... on Sat, 13 May 2000 3:1:49
When I join tables that have ambiguous columns, in MS Access 2000, I can 

specify an alias and the projected columns are no longer ambiguous.



Example:

select tablea.columna, tablea.columnb, tableb.columna, tableb.columnb from 

tablea, tableb.



results in ... 4 columns with unique names.



The same query executed in ADO generates a recordset where the columns are 

not qualified by the tablename.  Therefore, recordset("columna") represents 

two columns.  How do I reference one or the other column???



recordset(1) and recordset(3) would do it, but it's fragile.



Message #2 by "Ken Schaefer" <ken.s@a...> on Sun, 14 May 2000 17:13:07 +1000
SELECT tablea.columna AS aliasname, tableb.columna AS someotheralias



Response.Write(objRS("aliasname"))

Response.Write(objRS("someotheralias"))



HTH



Cheers

Ken

----- Original Message -----

To: "ASP Databases" <asp_databases@p...>

Sent: Saturday, May 13, 2000 12:00 AM

Subject: [asp_databases] Ambiguous columns with recordsets





> When I join tables that have ambiguous columns, in MS Access 2000, I can

> specify an alias and the projected columns are no longer ambiguous.

>

> Example:

> select tablea.columna, tablea.columnb, tableb.columna, tableb.columnb from

> tablea, tableb.

>

> results in ... 4 columns with unique names.

>

> The same query executed in ADO generates a recordset where the columns are

> not qualified by the tablename.  Therefore, recordset("columna")

represents

> two columns.  How do I reference one or the other column???

>

> recordset(1) and recordset(3) would do it, but it's fragile.


  Return to Index