Sign in to follow this  
boolean

[web] Simple ASP query question

Recommended Posts

I know this is dead simple, but I have two recordsets being used from the database on a page, and both of them have a field called 'comicid'. In one of the sections of the page I need to use one comicid from one recordset, and then the comicid from the second one. How can I tell the webpage which is which? I am using Micrsoft Access as the DB, and (I think) ASP VB script for the pages I tried to google, but it doesn’t like me tonight [bawling] Thanks.

Share this post


Link to post
Share on other sites
I can't say I really understand the problem too good either, but you could rename one of the fields using "as" in your SQL statement:

select something as somethingelse from atable

The recordset returned from that query will have a field called somethingelse instead of something.

shmoove

Share this post


Link to post
Share on other sites
Imagine you have two tables, Table1 and Table2. Each table contains comicid as a field. You can use them within the same query as Table1.comicid and Table2.comicid. I assume that's what you mean?

However, if I were to translate your original question literally, I'd say that each recordset is completely separated from the other and the only way you could detemrine which id to use would be through your own understanding of the system. Failing that, you could create a single recordset from both queries and perhaps have an intermediate translation table to join the two. This table would literally store one ID and the corresponding ID from the other table.

Other than that, I'd be able to help you more if you rephrased your original question [smile]

Share this post


Link to post
Share on other sites
To build off of evolution's suggestion, why not have two separate queries which both load a table in a dataset with unique names (tblUser, tblMachines for instance). YOU should know when you need to use which value, so it'll be a snap to do either a dataset read or dataset query depending on whether you only need part of the information or all of it at any particular time. Of course, you can also do this with separate queries one time if you don't need to reuse the data.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this