Error on importing data from SQL Server by ideascript

3 posts / 0 new
Last post
idemnos's picture
idemnos
Offline
Joined: 06/17/2016 - 13:25
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 05/09/2014 - 08:47

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", ""....