SQL Connection String

Started by Jeff, May 29, 2019, 07:31:34 AM

Previous topic - Next topic

Jeff

Hi all.
I am tinkering with WebBatch for the first time and doing a small project to get an understand of it. I am connecting to a SQL server database and pulling the DB information as expected. <I am proud!>

My current problem is the connection string is sitting in plain text with a SQL user name and password. I do not have the option to use domain authentication as part of the connection string. So, is there a way to hide or encrypt the connection string so the SQL username and password is not sitting in plain text?

SQLConn.ConnectionString = "Provider=SQLOLEDB;Data Source=MyServer;Initial Catalog=MyDataBase;User ID=MyUserId;Password=MyPassword"

Jeff

td

You could split your script into separate scripts and compile the script with sensitive information using the "Encode for calls from EXE files" compiler option.  You can then call the compiled .wbc file from a plan text .web script.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Jeff

Ok, I like the thought process, but I have some questions.

Can I call another exe from a WEBBATCH script?

Where is the material on making this work?
Jeff

td

You do not need to call "another exe" to call a compile .wbc file from WebBatch script.  You just use the WIL Call function to execute the encoded script from your WebBatch script. You treat the .wbc file just like you would any other script you execute using the WIL Call function.

Not sure what you mean by "material" but the compiler is documented in the Consolidated WIL Help file.  Go to:

Home > WinBatch Users Guide > Compiler > Compile Options > Encode for Call's from EXE files
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Jeff

Thanks-I just need to find the reading material or an example.
Jeff

td

There isn't "reading material" specific to calling a .wbc file from a script.  This is because the concept and implementation are very simple.  If you are not familiar with the WIL Call function, read about it in the Consolidated WIL Help file. The function is used in many places in the Tech Database.  Once you understand calling one script from another you just need to use the WinBatch Compiler to create an encrypted version of the script you want to call and then call it using the WIL Call function.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade