Login Failed

Glenn Walker 251 Reputation points
2021-02-03T01:36:35.783+00:00

I have recently installed SQL Express 2019 with SMSS. I now have a database that I want to connect to with Visual Basic.

When I attempt to connect to the database I get the message below.

63272-screenshot.jpg

I have been unable to find out where I need to go to correct this.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,871 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-02-03T07:05:21.207+00:00

    Hi @Glenn Walker ,

    What version of the database file that you are attempting to connect to? Your SQL server version SQL 2019. Did the database file is also created in SQL 2019 or lower version?

    This is thread has same error message with yours, please check if it could help you.


    If the response is helpful, please click "Accept Answer", thank you.

    0 comments No comments

  2. Olaf Helper 41,011 Reputation points
    2021-02-03T07:14:03.823+00:00

    Login failed means that you current Windows account don't have access permissions for SQL Server.
    During installation, have you added your login to the system admin role?

    If not, run SSMS as admin and add your account to the SQL Server role "SysAdmin".

    0 comments No comments

  3. Glenn Walker 251 Reputation points
    2021-02-03T19:13:21.617+00:00

    Cathy,

    The database was created, using SMSS, within SQL express 2019. I reviewed a number of threads and was unable to find anything I was able to make fit.

    Olaf,

    I am not very familiar with SQL Server. Although I was aware that my account does not have the permissions.

    Where would I be able to make this change? I have opened server properties in SMSS and I have gone through permissions, et. al., properties and have been unable to do this.

    0 comments No comments

  4. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-02-04T02:17:29.567+00:00

    Hi @Glenn Walker ,

    >Where would I be able to make this change?

    Connecting to SQL server 2019 Express using a admin account. Then add your account GLENNWALKERSITE\glenn to the sysadmin server role as below screenshot.

    63773-screenshot-2021-02-04-101651.jpg


    If the response is helpful, please click "Accept Answer", thank you.

    0 comments No comments

  5. Glenn Walker 251 Reputation points
    2021-02-05T16:50:55.77+00:00

    Well, I did all of that Cathy. still no joy.

    I am truly having a hard time understanding why it is so difficult to create a database (using SQL Express), then not be able to open or use it with VB.

    Or alternatively, not be able to load an already created SQL database to SQL Express.

    0 comments No comments