Skip to main content

Error on importing data from SQL Server by ideascript

Hi there.
I'm imported some info from a SQL Server, wich uses LDAP trusted authentication, so I donĀ“t need to provide any credential (user or password), just to log on in Active Directory. I copy the script generated in History, copy, paste and execute and it throws this error message: Acces Denied.
This is the code: 
Sub Main
Call ODBCImport()'
End Sub
Function ODBCImport
dbName = "INV_CHK_CTAS.IMD"
        Client.ImportODBCFile "" & Chr(34) & "dbo" & Chr(34) & "." & Chr(34) & "spt_fallback_db" & Chr(34) & "", dbName, FALSE, ";DSN=SQLSRVR;UID=;Trusted_Connection=Yes;APP=IDEA;WSID=AI43651;DATABASE=DBSAC;ApplicationIntent=READONLY;", "select a.*, b.nom_cuenta as nom_cta_ban om DBSAC..a, DBSAC.. b where a.cod_a = b.cod_b"
Client.OpenDatabase (dbName)
End Function
Any help is appreciated, thanks!

Brian Element Wed, 04/04/2018 - 07:40

Hi there, I have never dealt much with SQL Server so I am not in a position to help you out, hopefully someone else can or if you have a maintenance contract with IDEA I would suggest contacting them with your question.

Polleke Mon, 04/23/2018 - 11:46

The message Access Denied will also appear if the table doesn't exists, maybe misspelled or there is a typo in the select statement. Its not always a security/GPO issue. Try a more simple and readable query  like this first (skip the " & Chr(34) & ", the WSID and ApplicationIntent parts to keep it compact at one line.
....Client.ImportODBCFile "dbo.spt_fallback_db", dbName, FALSE";DSN=SQLSRVR;UID=;Trusted_Connection=Yes;APP=IDEA;;DATABASE=DBSAC", ""....