l-wright

Lua Connecting to a MSSQL database via integrated security

Discussion created by l-wright on Aug 16, 2013
Latest reply on Aug 16, 2013 by ntimm

we have an database which we want to use a lua script to access and to run a stored procedure against and add the returned data to a note on a alarm.

 

we are having issues in opening the connection.

 

al = alarm.list ()

database.open("Provider=SQLOLEDB;Initial Catalog=database_name;Data Source=Database server;Network Library=dbmssocn;Language=us_english;Integrated Security=SSPI")

print("Opening connection")

rs = database.query("exec storedproc + parameters")

code to add the data to the note

database.close()

Outcomes