Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Ambigous troulbe with asp and sun-asp

Author  Topic 

scope
Starting Member

6 Posts

Posted - 2007-07-28 : 16:18:03
hi

I have a trouble with my ASP-script. It works fine on my microsoft server. But on the unix SUN-ASP-server there is a problem.

I am make an SQL-call where I have 2 ambigous fields (ie two identical from two different tables). It is no problem access the data, but when i am going to get the data it gives me an error.

It's like this:

SQL="Select usernames.*,team.* FROM usernames,team;"
set rs=conn.execute(sql)
(both usernames and teams has the field ID"

And now when i get data i noramlly use

id1=rs("usernames.id")
id2=rs("team.id")

But this xxx.yyy in rs DOESN'T work on the sun server compared to my Access-server.

How can i resolve this? Hope to get help on this ;)

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-07-28 : 16:19:51
Generally its good to spell out the columns instead of using "*".

You might want to use column alias to differentiate the IDs.

SELECT UserId = USerName.Id, TeamId = Team.ID ....

And refer to the columns as UserId and TeamId from your frontend.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-28 : 17:13:40
Dupe http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=87023



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -