Last Updated: February 25, 2016
·
482
· mhdnoufel

SQL Server Connection through .ini File

mvarConnectionString = "Provider=sqloledb;"
mvarConnectionString &= "Data Source=" & mvarServerName & ";Network Library=DBMSSOCN;"
mvarConnectionString &= "Initial Catalog=eAlert;"
mvarConnectionString &= "User ID=" & mvarUserName & ";Password=" & mvarPassword & ";"

mvarServerName = ""
mvarUserName = ""
mvarPassword = ""

KeyName(1) = "ServerName"
KeyName(2) = "UserName"
KeyName(3) = "Password"

ReadINIFile("C:\eAlert.ini", "eAlert", KeyName, KeyValues)

mvarServerName = KeyValues(1)
mvarUserName = KeyValues(2)
mvarPassword = KeyValues(3)

INI File

[eAlert]
UserName=sa
Password=Altius2005
ServerName=CBE-SERVER