VBScript provides one of the best ways to connect to any kind of database. That is through the ADODB connection.
You just need to have the correct connection string with the right credentials. If you have these two then you can write code to connect to almost any kind of database in just 3 lines.
In order to connect to the database, we need to follow below steps:
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset")
con.open"Driver={SQL Server};server=MySqlServer;uid=MyUserName;pwd=MyPassword;database=pubs"
rs.open "select * from emp",con
This will store the data into the recordset object rs.
This page has all the code needed for connecting and reading data from popular database types using VBscript.