Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: philchudley on June 23, 2010, 02:10:10 am
-
Hi All
Does anyone out there know the meaning and cause of the following message appearing in an Add-In?
Error:
Code = 0x0
Source - Line : 0; Char : 0;
Error Description = (null)
It is appearing after executing the command
Repository.SqlQuery
The query does in fact return the correct the result, but the error dialog is incredibly annoying and I cannot make it go away! :-[
Cheers
Phil
-
What does the query look like, and do you have this issue every time you use SQLQuery?
I know EA doesn't like insert/update/delete statements being passed to SQLQuery, so it might be something like that?
Geert
-
I had this message too, but I can't remember how I got rid of it... Most likely it was me doing something wrong, but what???
b.
-
Thanks Guys for the replies, the situation breifly is:
I am modifying an Add-In for a client that is going to work on shared models, and will be doing fancy things with profiles and tagged values (synchnronising tagged values is just one of them).
They use "require lock for edit", so before updating a list of elements I need to check the lock status, and only work on unlocked or locked for the current user elements.
The discovery of whether locks have been applied is easy and works fine. The problem (the error message) occurs on the following query
queryResult = String.Empty;
queryResult = repository.SQLQuery(@"SELECT * FROM t_secuser " +
@"WHERE USERID = '" + userID.InnerText + "'");
Which is taking a userID from the first query XML result and discovering the user name etc
The query above does work and does retrieve the correct results.
For testing I have created a small test EA file which is a shared model, with security enabled. The users defined are the default admin and another called Phil, who is a member of the Adminstrators group
When running the add-in logged in as Phil, all is fine ... correct results are obtained and no error. However repeating the process logged in as admin, produces the correct results, but the error message occurs when looking up Phil.
Cheers
-
Hi Guys
Problem solved, the query was changed to
queryResult = repository.SQLQuery(@"SELECT UserLogin, FirstName, Surname FROM t_secuser " +
@"WHERE USERID = '" + userID.InnerText + "'");
That is not using * in the SELECT and all is fine now
Cheers
Phil
-
Phil,
Good you figured it out.
I suspected it might have something to do with the actual query.
Geert