You are viewing limited content. For full access, please sign in.

Question

Question

Error executing SQL command

asked on December 15, 2014 Show version history

I recently updated a client to Server version 9.2.  I'm running the following script with the 8.0 toolkit and 9.2 server:
set app = CreateObject("LFSO80.Application")

'Name of the server where the Laserfiche Server lives
Const LF_SERV = "127.0.0.1"
'LF_SERV = InputBox("Laserfiche Server IP:")

'Name of the Laserfiche repository that will be used for import
Const LF_REP = "Main"
'LF_REP = InputBox("Laserfiche Repository:")

'Name of the Laserfiche User that will be used for importing
Const LF_USER = "mvi support"
'LF_USER = InputBox("Laserfiche User Name:")

'The respective Laserfiche User's password
Const LF_PASS = "xxxxxxxxx"
'LF_PASS = InputBox("Laserfiche User Password:")

set serv = app.GetServerByName(LF_SERV)
set db = serv.GetDatabaseByName(LF_REP)
set conn = CreateObject("LFSO80.Connection")
'set result = ""

conn.UserName = LF_USER
conn.Password = LF_PASS

conn.create db

set allGroups = db.GetAllGroups()

      For i = 1 To allGroups.Count
        set group = allGroups.Item(i)
 result = result & " "
 result = result & group.Name
      Next

      MsgBox(result)

conn.Terminate

 

I'm getting the error "Error running SQL Command" when running the script.


I'm Getting the following error in Windows event logs:

Database statement execution error encountered.  Session ID: 614; Dialog ID: 9940; Repository: 'Main'; CLI routine: SysLinkedAcctOpenListing; Message: [Microsoft][SQL Native Client][SQL Server]Ambiguous column name 'sid'.; SQL Statement: 'select trustee_name, u.sid, account_name from (select trustee_id as id, sid from trusted_group union select userid as id, sid from trusted_login) u left join trustee on id = trustee_id left join account_cache on u.sid = account_sid where left(sid, 2) <> 0x0106 order by trustee_name, account_name'; SQL variable: ''; SQL State: 42000

 

If I take the sql query that is spelled out in the log and post it in SQL management studio, then run the debugger on it, it gives me the error "ambiguous column name" for the "sid" in the parentheses at on "u.sid = account_sid where left(sid, 2)"

 

I'm stumped.

0 0

Answers

APPROVED ANSWER
replied on January 13, 2015

This issue is fixed with Laserfiche 9.2 SP1. Please download the service pack from KB 1013588.

0 0
SELECTED ANSWER
replied on December 15, 2014 Show version history

This looks to be an issue with using LFSO80 and LFS 9.2. However, can you update your application to use LFSO81 or higher?

0 0

Replies

replied on December 15, 2014

Additional information.  I found a similar issue at: https://answers.laserfiche.com/questions/62128/Workflow-activity-search-SQL-error-ambiguous-column-name

I found that, like the poster, my db was set to a compatibility level of 2000.  I set it to 2008, but it did not resolve the issue.

0 0
replied on December 15, 2014

Unfortunately, the IIS app that I'm using can only use LFSO80 or older.  Any way we can work around it?

0 0
replied on December 15, 2014 Show version history

It doesn't appear that this is something that can be worked around. We have a server bug filed for this.

However, can you clarify why the application can't use a newer version of LFSO? Using your above code, do you get an error if you change LFSO80 to LFSO81? You'd just need to make sure that the relevant files are installed, but they should be as long as the newer SDK runtime is installed.
 

0 0
replied on December 16, 2014

The code I posted isn't exact to what is in the app.  It's what our developer gave me to demonstrate and test whether the call would work.  The app is an older version and may not be able to be modified.  I'll have to check with our development team.  As for the bug you have filed, does that mean that there might be some kind of fix forthcoming?

0 0
replied on December 16, 2014 Show version history

Yes, a future release of the Laserfiche Server will have a fix. We don't have an ETA yet.

A support case has been opened on your behalf and we'll look into providing a fix. However, I'd still recommend updating your application to use a newer version of LFSO.

0 0
APPROVED ANSWER
replied on January 13, 2015

This issue is fixed with Laserfiche 9.2 SP1. Please download the service pack from KB 1013588.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.