Furek86 Posted May 14, 2010 Share Posted May 14, 2010 Hi everyone. I have been recently working with Autoit trying to manage an MS SQL Database. I have successfully connected to it and ran few queries. However now I am facing an issue. Let me explain: I have two tables in my base: tblAssets & tblBuildings. tblAssets contains records regarding a specific asset, but there are only two that are needed in this case - Description (assets description) & BuildingID (a specially generated ID of a building the asset is in). tblBuildings contains also two records I am intrested in - Description (building description) & BuildingID (a specially generated ID of a building the asset is in). The problem is: I want to use a query that will query those two tables and retrieve Asset's Description from tblAssets and Building's Description from tblBuildings. I noticed that when I use a recordset, autoit returns an error when trying to use for instance $rs.Fields("tblBuildings.Description").value.. Any ideas how to resolve this? Link to comment Share on other sites More sharing options...
zorphnog Posted May 14, 2010 Share Posted May 14, 2010 (edited) Post the relevant code that you have including the query and the recordset value retrieval that you are having an issue with. We can't help you without more information. Edited May 14, 2010 by zorphnog Link to comment Share on other sites More sharing options...
tehdon Posted May 14, 2010 Share Posted May 14, 2010 I think the recordset returned from the query will contain just the column names even though you are joining two tables. So the record you are attempting to access would actually be name 'Description', not 'tblBuildings.Description'. Try referencing $rsFields("Description").value and see if that gets you past the error. If you have two identically named columns in the tables being joined, rename one or both using the AS statement in the SELECT statement. Link to comment Share on other sites More sharing options...
Furek86 Posted May 19, 2010 Author Share Posted May 19, 2010 Thanks Tehdon Now my query works perfectly Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now