Excel instance requesting SQl login credentials

I have an Excel worksheet in which I created a pivot table that takes data from an Sql table. I download this Excel sheet from the application to the client machine, and when we try to open it in the client machine, it asks for the login credentials of the SQl server. Is there a way that after loading on the client machine the sheet does not ask for credentials for entering SQL, and we will hard-code or install it in Excel itself. The user simply opens or logs in, and when he opens the fulcrum, Datasourse will not automatically request SQl Login and update the data source.

+6
source share
1 answer

I solved this by following the steps below.

  • Create a user on SQL Server and give him permission to the desired database.
  • Open Excel-> Click on the "Data" tab
  • Click Existing Connection. A popup will appear.
  • At the top of the popup you will find "Connections in this book." Right click on it.
  • Click "Change connection property."
  • The connection property is displayed. The Definition window appears on the Connection Properties tab.
  • Edit the connection string and add the user ID and password in the connection line and specify the user ID and password that you created in step 1.
+6
source

Source: https://habr.com/ru/post/909184/


All Articles