I'm trying to use `sp_send_dbmail` to send the results of a query through a SQLAgent job in SQL Server 2014. I believe I have my DBMail profile set up properly but when running this:

```
exec msdb.dbo.sp_send_dbmail
@profile = 'TestProfile',
@recipients = 'testmail@gmail.com',
@subject = 'Test',
@query = 'SELECT id FROM TestTable',
@attach_query_result_as_file = 1,
@query_attachment_filename = 'TestValues.txt'

```

I get the following error message:

```
Failed to initialize sqlcmd library with error number -2147467259.

```

Googling this error message didn't turn up anything useful, likely due to the generic error number. Anyone have some insight into this error message?