cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Connection String Issue

CalebMason
Level 2
Hi, I am having an issue pulling SQL data into a collection. The error I am getting is "The ConnectionString property has not been initialized." The weird thing is that the syntax has not changed, and the code was working last week... Anyone have any idea why this is happening?


Thanks,

------------------------------
Caleb Mason
RPA Developer
Lockheed Martin
------------------------------
Caleb Mason RPA Developer Lockheed Martin
8 REPLIES 8

SamStone
Staff
Staff

Hi Caleb,

Is it possible the username/password combination (or indeed any other auth method) within the connection string has expired/changed since it was previously working?

If that's not changed, and if you're using the Data - SQL utility object, are you connecting with individual details (host, server etc) or providing a connection string yourself?

Hope we can find an answer for you!



------------------------------
Sam Stone
CoE Build Lead
Blue Prism
------------------------------
Sam Stone CoE Build Lead [CompanyName]

AyshaM
Level 3
Were you able to resolve this issue? We are getting the same problem at the moment.


So we did solve the issue. I was needing to connect to two separate databases on the same server. However, when I was trying to connect to the second database, I was not setting the connection because I thought the previous connection to the server from the first connection was enough. Once I used the Data - SQL Server - CE Device (Set Connection) action, I was good to go. Hope that helps!

------------------------------
Caleb Mason
RPA Developer
Lockheed Martin
------------------------------
Caleb Mason RPA Developer Lockheed Martin

Thank you so much for the prompt response.

So, What I have done is  the following:
1. Created a copy of the Data SQL Server object
2. Added in the "Set Connection" Stage ";Trusted_Connection=Yes" for both the Yes and No decision stage to set the connection string

3. Then used this modified SQL Server object to make a connection string
4. Then "Execute" for running a query

That's when i get the error of " Connection String property not initialized" on step 4 essentially.



------------------------------
Aysha M
------------------------------

Okay so make sure that you are sending all the necessary inputs over. So your Server, Database, User, and Password should all be populated. From what you are saying, it is the same issue I was having.

Was there a reason why you had to make a copy of the object and add the Trusted Connection piece?



------------------------------
Caleb Mason
RPA Developer
Lockheed Martin
------------------------------
Caleb Mason RPA Developer Lockheed Martin

So, the original and the exact requirement is that we need to connect using windows authentication , but as a different user.

Essentially, if I were to do this in Management SQL Studio, what I would do manually are the following steps to connect:

1. Press shift and click on the Management SQL Studio
2. Click on Open as a different user
3. Provide the username/Password credentials
4. The Management studio now opens as a different user (essentially, the username will not be my default Windows user id)
5. I provide the Server Instance detail and click on connect.

If I were to mimic this exact approach to connect via Blue Prism, what is the approach you would suggest?

------------------------------
Aysha M
------------------------------

Okay so does the bot you are working with have access to SQL?

If so, you SHOULD be able to Set Connection, test the connection using Get Number if you desire to, and then Execute your query using like you are wanting to do. Just ensure that all of your parameters for Set Connection are populated and correct. If there is an issue still after that, maybe try testing the SQL access manually to ensure that you have the access that you need to be able to connect to the server.



------------------------------
Caleb Mason
RPA Developer
Lockheed Martin
------------------------------
Caleb Mason RPA Developer Lockheed Martin

Hey thank you so much for your responses.

I was able to resolve it, turns out was a matter of internal access in our environment

------------------------------
Aysha M
------------------------------