Hamtash
Hamtash

Reputation: 147

connection to SQL database with Office script

is it possible to make a connection between Office 365 to SQL database using Office scripts? something simillar to ADODB.Connection in Excel VBA

Upvotes: 2

Views: 3118

Answers (1)

Brian Gonzalez
Brian Gonzalez

Reputation: 1356

You can't connect directly to a database using Office Scripts. You can still get data from a database but the process would need to be a bit different:

  1. Instead of querying a database directly, the data would need to be returned to some API (e.g. as JSON)
  2. Instead of providing a username / password to connect to the database, you'd use an API key.
  3. Once you had access to an API and provided an API key, you could use fetch to get the JSON and work with the data in Office Scripts.

You can read more about using fetch with Office Scripts here

In addition to this type of process, you could also trying using something like PowerAutomate to query the database directly.

Upvotes: 3

Related Questions