Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Connection string in with sqlserver 2005

Connection string in with sqlserver 2005

Scheduled Pinned Locked Moved Visual Basic
databasesql-serversysadminsecurityhelp
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nazimghori
    wrote on last edited by
    #1

    Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is

    Public DBConn As ADODB.Connection

    DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
    DBConn.Open DBConn.ConnectionString

    Please suggest Thank you.

    L D T 4 Replies Last reply
    0
    • N nazimghori

      Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is

      Public DBConn As ADODB.Connection

      DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
      DBConn.Open DBConn.ConnectionString

      Please suggest Thank you.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This is VB forum, please post this question in the Database forum.

      1 Reply Last reply
      0
      • N nazimghori

        Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is

        Public DBConn As ADODB.Connection

        DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
        DBConn.Open DBConn.ConnectionString

        Please suggest Thank you.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        It'll be logging in on your first computer using Windows Authentication. Has the sa-account been enabled? Does the second PC have the correct password?

        Bastard Programmer from Hell :suss:

        1 Reply Last reply
        0
        • N nazimghori

          Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is

          Public DBConn As ADODB.Connection

          DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
          DBConn.Open DBConn.ConnectionString

          Please suggest Thank you.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You cannot use a database file on the local machine when connecting to a remote SQL Server instance. You have to switch to a non-user-instance config string and permanently attach the database file on the remote machine to the SQL Server instance on the remote machine. This is easiesst done using the SQL Server Management tool. Then you can change the Initial Catalog option in your connection string to the database name you assign on the SQL Server. If you're going to be using Integrated Security, do not supply a username and password. If you have to supply a username and password, do not use Integrated Security. The two options are mutually exclusive.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          N 1 Reply Last reply
          0
          • N nazimghori

            Hello, I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. where as it runs perfetly on 1st computer. my conection string is

            Public DBConn As ADODB.Connection

            DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
            DBConn.Open DBConn.ConnectionString

            Please suggest Thank you.

            T Offline
            T Offline
            thatraja
            wrote on last edited by
            #5

            Looks like you have posted this question multiple times There are so many reasons for this error. This bunch has the solution(s), check it. Steps to troubleshoot SQL connectivity issues[^] SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^] BTW I gave you this bunch also for future errors.

            thatraja


            **My Tip/Tricks
            My Dad had a Heart Attack on this day so don't...
            **

            L 1 Reply Last reply
            0
            • D Dave Kreskowiak

              You cannot use a database file on the local machine when connecting to a remote SQL Server instance. You have to switch to a non-user-instance config string and permanently attach the database file on the remote machine to the SQL Server instance on the remote machine. This is easiesst done using the SQL Server Management tool. Then you can change the Initial Catalog option in your connection string to the database name you assign on the SQL Server. If you're going to be using Integrated Security, do not supply a username and password. If you have to supply a username and password, do not use Integrated Security. The two options are mutually exclusive.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              N Offline
              N Offline
              nazimghori
              wrote on last edited by
              #6

              Hello, I changed my connection string to

              DBConn.ConnectionString = "Provider=SQLNCLI;AttachDBFileName=" & App.Path & "\newdb.mdf;Database=newdb;User Instance=true;Trusted_connection=Yes;"

              but it gives me run time error like Invalid connection string attribute.. Can you please suggest which attribute is invalid. Thank You.

              modified on Sunday, July 31, 2011 12:28 PM

              D 1 Reply Last reply
              0
              • T thatraja

                Looks like you have posted this question multiple times There are so many reasons for this error. This bunch has the solution(s), check it. Steps to troubleshoot SQL connectivity issues[^] SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^] BTW I gave you this bunch also for future errors.

                thatraja


                **My Tip/Tricks
                My Dad had a Heart Attack on this day so don't...
                **

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                thatraja wrote:

                Looks like you have posted this question multiple times

                And you still keep answering him each time?

                T 1 Reply Last reply
                0
                • N nazimghori

                  Hello, I changed my connection string to

                  DBConn.ConnectionString = "Provider=SQLNCLI;AttachDBFileName=" & App.Path & "\newdb.mdf;Database=newdb;User Instance=true;Trusted_connection=Yes;"

                  but it gives me run time error like Invalid connection string attribute.. Can you please suggest which attribute is invalid. Thank You.

                  modified on Sunday, July 31, 2011 12:28 PM

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  How many times have you asked this question? You don't have a clue what you're doing, do you? You haven't understood any of the things I said in my other post and know nothing of what's in the connection string. Your "second" attempt you posted contains none of the fixes I told you about and you're still trying to attach a remote instance of SQL Server to a local file, which will not work. http://www.connectionstrings.com[^]

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  1 Reply Last reply
                  0
                  • L Lost User

                    thatraja wrote:

                    Looks like you have posted this question multiple times

                    And you still keep answering him each time?

                    T Offline
                    T Offline
                    thatraja
                    wrote on last edited by
                    #9

                    No, only 2nd time :sigh:

                    thatraja


                    **My Tip/Tricks
                    My Dad had a Heart Attack on this day so don't...
                    **

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups