Database connection failed

  • Dear Steave,

    I am facing one problem with SQL connectivity from the application. Please guide me the same.

    Details as follows:

    1. Operating system is Win 2008, 64 Bit

    2. SQL 2008 R2

    3. Tried to connect SQL with ODBC and Management Studio, it is connecting fine

    4. But when i am trying to connect the SQL from my VB application it is failing and showing the error (Database connection failed)

    Run time error 2147467259 - 80004005 [DBNMPNTW] Access denied

    5. Then we have stopped all SQL 2008 services and installed SQL 2005 express then also data base connection failing (but connecting ODBC and MSMS)

    what could be the reason and what is the solution for the same?

    Please check and suggest for same

  • There is very little information in your post so I am speculating but that sounds like a permissions issue. Check your connection string and make sure the user has access to the database you are trying to connect to. If you google the error message you posted there are lots of people that have run into this issue and there a lot of reasons but they all appear to be related to permissions.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Hi Sean Lange

    Logged user was Administrator and having full rights, from VB applciation SQL is not connecting and showing above mentioned error but from .net application SQL is connecting properly.

    Any solutions plz...

  • Try changing your connection string to use SQLNCLI (SQL Native Client).

    Post your connection string.

    Also check to see what the users default DB is. Some people set a default DB to a blank DB for security purposes but forget to grant rights into that DB.

  • Tried the same (SQLNCLI) but no use. Also default db is master.

    Actual my problem is from any VB application I am not able to connect the database but from .Net application can able to connect the db

  • Post your connection string. Just change the server name, IP address, db name and credentials.

    From the PC you are trying to connect with, can you connect using a UDL or local systen DSN?

  • Tried both Connection strings

    PROVIDER=SQLOLEDB;SERVER=SERVER\SERVER;UID=sa;PWD=P@ssw0rd;DATABASE=MASTER

    PROVIDER=SQLNCLI10;SERVER=SERVER\SERVER;UID=sa;PWD=P@ssw0rd;DATABASE=MASTER

    Also DSN is working fine, only connecting from VB 6.0 is failing

    Any idea ?

  • www.connectionstrings.com

    It might also be that the connectivity drivers are not installed on your machine.

  • Problem is not solved. Any Suggestions....

  • not without seeing your current error message.

  • Run time error 2147467259 - 80004005 [DBNMPNTW] Access denied

    while connecting the Database Server from VB application

  • The connection string is fine. You need to give the correct permissions to the user you are trying to connect with.

  • Provider=SQLOLEDB.1;Data Source=

  • Raamamohan (8/25/2011)


    Run time error 2147467259 - 80004005 [DBNMPNTW] Access denied

    while connecting the Database Server from VB application

    Do SSMS, .net application and VB application are on the same server or on different ones ?

    --

    SQLBuddy

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply