SQL Server Management Studio - Server Names Disappeared - sql-server-2008-r2

The first dialog box you get when opening SSMS (mine is 2008 R2) allows you to choose which server you want to connect to.
I had at least six servers in that list, including a local server called something like MYPC/SQLSERVEREXPRESS
Windows Updates ran last night and rebooted my machine, and now my SSMS list of servers is gone. I can select (local) or (browse for more)
What happened to my previously saved servers and their saved login info?

The file that stores these for 2008 is found at c:\%UserProfile%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
My guess is that it is still there, but was overwritten by one of your updates, you can check it to see when it was last modified.
You should make use of registered servers and export the file to save time if this happens again.

As I understand, you want to retrieve your credentials from that file.
There is a way to restore your passwords, if you still have sqlstudio.bin file and you can see "password" entries there.
First, some theory: When SSMS saves connection object it encrypts the password using some encryprion method, that is BOUND to your windows login. If you try to copy the sqlstudio.bin to other machine/user profile, passwords will not be decrypted. So it is important that you do all actions under same windows account, that you have used then sqlstudio.bin was generated. I can not tell you, if you can directly manipulate sqlstudio.bin - I suppose there are some checksums there which will prohibit direct manipulation, but there is another way.
I know the information I written above, because I develop myself an add-in for SSMS - SSMSBoost. I have implemented there the logic to manage preferred connections (so that you actually will not need standard dialogue anymore). I use exactly the same SSMS objects to store connections and serialize then into XML, so it is easier to manipulate.The picture below shows contents of sqlstudio.bin and SSMSBoostSettings.xml for the same connections. You can recognize, that username and password binary data are the same. So, to restore your password you have to:
install ssmsboost
add preferred connection to ANY database with sql server security
open SSMSBoostSettings.xml (you will see the path to that file in settings dialogue, after you have saved settings. Just save, close and re-open it. Path is displayed at the bottom)
Close SSMS, open sqlstudio.bin and ssmsboostsettings.xml in editor
modify entry in ssmsboostsettings.xml - enter data of your server from sqlstudio.bin - adress, database name, username. Carefully copy password data.
save xml and open SSMS - SSMSBoost will now show your connection in preferred connections and you will be able to connect to database. (see second picture)

Related

Can I upload a file to onedrive via Windows 10 command line?

I need to upload a file to OneDrive, via the command line. This will be done through a batch file which is distributed to end users.
From searching on Stack Overflow, I find questions like this one which say that you need to register an app and create an app password, using Azure. I don't have the necessary permissions to do this in the organization where I work, nor can I do anything that requires an admin account. So I can't any install software - I have to use what comes with Windows 10. I can't use VBA either as that's blocked.
I've managed to download files from OneDrive without anything like that, using the process described here:
Open the URL in either of the browser.
Open Developer options using Ctrl+Shift+I.
Go to Network tab.
Now click on download. Saving file isn’t required. We only need the network activity while browser requests the file from the server.
A new entry will appear which would look like “download.aspx?…”.
Right click on that and Copy → Copy as cURL.
Paste the copied content directly in the terminal and append ‘--output file.extension’ to save the content in file.extension since
terminal isn’t capable of showing binary data.
Example:
curl https://xyz.sharepoint.com/personal/someting/_layouts/15/download.aspx?UniqueId=cefb6082%2D696e%2D4f23%2D8c7a%2
…. some long text ….
cCtHR3NuTy82bWFtN1JBRXNlV2ZmekZOdWp3cFRsNTdJdjE2c2syZmxQamhGWnMwdkFBeXZlNWx2UkxDTkJic2hycGNGazVSTnJGUnY1Y1d0WjF5SDJMWHBqTjRmcUNUUWJxVnZYb1JjRG1WbEtjK0VIVWx2clBDQWNyZldid1R3PT08L1NQPg==;
cucg=1’ --compressed --output file.extension
I tried to do something similar after clicking 'upload' on the browser, but didn't find anything useful when trying to filter the requests.
I found these two questions but there is no keyboard shortcut to upload, AFAICT. Also the end user will be uploading a file to a folder I've shared with them from my OneDrive. Opening Chrome or Edge as a minimised window is fine, but I can't just shove a window in their face which automatically clicks on things - they won't like that.
It's just occurred to me that I might be able to use an office application to Save As the file to the necessary onedrive folder, where the keyboard shortcuts are pretty stable, but have no idea how to achieve that via the command line.
The best and more secure way to accomplish this goal I think is going to be with the Rest API for OneDrive.
(Small Files <4MB)
https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content?view=odsp-graph-online
(Large files)
https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online
You still need a Azure AD App Registration (which your admin should be able to configure for you), to provide API access to services in Azure. Coding with the API is going to be far easier and less complicated, not to mention more versatile.

Crystal Report ODBC connection only shows "Add command"

I'm supposed to set up a crystal report for something less than exciting. This is my first experience using Crystal Reports (and its been agony).
When I add an ODBC connection, I put in the password (confirmed it works elsewhere) and press all the "Next" there are, and then I end up with this this:
I also am able to use a direct query when I do "add command" and can access the database tables that way, but this is less than ideal.
My understanding is that the tables from the database are supposed to be listed under my connection, but all I see is "add command"
Does this mean I am not connected to the Database?
How do I correct this?
Verify that the user you setup in the ODBC Data Source Administrator has access to those tables in the database.

Typing in password for every connected table from SQL Server 2008 R2 in Excel 2010 Powerpivot Addin

I've got a BI Dashboard in Excel 2010 using Powerpivot, which is connected to a number queried tables on one SQL Server. When the connections were setup, I checked the box to 'save password' on each one. However, whenever my users reopen the document and go to the Powerpivot window and select 'RefreshAll' then they have to type in the password multiple times (once for each table), which is not suitable.
I have looked here and here and seem to be experiencing the same issue as a number of other people. I have started again from scratch, ensuring that the 'save password' box is definitely checked on each connection string.
The only workaround I can think of is by user Windows Authentication, but this document is intended for widespread use, and as such this will require a lot of maintenance, and will really annoy my server admin :)
Does anyone have a workaround, or any way of resolving the problem?
This solution comes close, but doesn't seem to work in my case. Might work for others though...
Solution summary:
In the main Excel window in the Data tab, choose Connections, then select the workbook connection that corresponds to your PowerPivot connection. Click on Properties, switch to the definition tab, and mark “Save password” box.
Source:
http://cpa-it.com/password-not-saved-in-powerpivot-connection-when-using-sql-authentication/#comment-10654
I've found a workaround that works for me, but might not be an ideal solution for others.
In the main Excel window, you can create a new connection using a connection file (.odc). If you create this file on a shared network drive that all users can access, and select to store the password in the connection file, the password is -actually- stored.
You can then go on and use this connection in the PowerPivot window. It will no longer ask for a password when refreshing your tables.
Of course this is only a useful workaround within a company LAN, and if there are no security implications for storing the password on a fileserver in an odc file.

Import data from an Access database into Word

I have created a program that runs off of an Access database on the company server. The program is running fine and I am about to release it to the office. Before I do this I would like to write a help file in case the users run into issues. However, I am running into problems here. In the program, each user has a security level that is retrieved from the database that allows them to have access to different features in the program. I would prefer that only certain users know about some of the features. In writing a help file for all of the features, I would like to have Microsoft Word read the security level from the database and only display the portions of the help file corresponding to the features the user has access to. I have tried using the following VBA code in the Document_Open event:
Set db = OpenDatabase(databasePath, False, False, databasePassword)
But I get an invalid password error (the database is password protected). I have verified the correct password several times now and still no luck. Does anyone know what I am doing wrong? Is there some other way to connect to an Access database using Word?
Why not include the help in a table with a rich text memo? Each section can be contained in a different record.
When creating such a table I generally have a help button that opens the relevant section and an extra field to allow annotation.

Filemaker 11 Perform Script in another file

I want to run a script in one file (A) from another file (B). In file B I have a script step: Perform Script [“email test” from file:”A”]
File A is password protected, so when the script runs a login dialog box comes up, but I want this to run automatically in the background without having to enter a password. File B is a timed file? How do I do this?
Add the same username and password in File A as File B.
Then in File A goto File -> File Options and tick Log in using and fill in the credentials.
File A will open without asking for a username/password and when it opens File B to call the script it will pass on the authentication details.
Offhand I can think of three techniques you can use to run the script in File A without needing to enter the password each time.
First, on the Mac there is the option to "Remember my password" when you log into File A. If you check this, FileMaker will look up the password when File B performs the script in File A and should automatically log in. I don't know if such a feature exists in Windows but it might be possible to do the same thing there.
Second, once a user is authenticated with FileMaker, FileMaker will try to use the same authentication credentials for any other database that the first database tries to open. So, as Adam suggests, you can add the same Username and Password used in File A to the Security section of File B. From there you would change the File Options to auto-login with the Username and Password you transferred. You should now automatically log in to both File B and File A.
Third, you could manually log into File A and just leave it open. This technique isn't as robust as the first two as you would need to manually log in again each time the file shuts down or connectivity is lost.
A Few Words About Security
File A probably has a password for a reason. When doing techniques like this it is certainly best to think about security and what people should be allowed to access if they gain access to your computer. At minimum your computer should probably require a password both at login and whenever the screensaver is deactivated just to ensure that people without authorization aren't able to access File A when they shouldn't.
Remember that, with the second technique, anyone who gains access to File B can now access File A with your credentials so you definitely want to be careful with File Sharing and letting others use your computer.