CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 1999
    Location
    Poland
    Posts
    278

    MS SQL 2000, remote connection

    Hello

    I try to play with Microsoft SQL 2000 ( 8.0 ).
    I'm able to connect when I run my application where the MS SQL 2000 is installed.
    Could you please help me to build ConnectionString to make remote connection.

    I do it as folows ( ... but I catch error "{SQL Server does not exist or access denied.} " )

    Code:
    SqlConnection myCon = new SqlConnection();
    myCon.ConnectionString = "Data Source=192.36.66.139,1433;Network Library=DBMSSOCN;Initial Catalog=" + dbname + ";User ID=sa;Password="
    btw, I found some helpful info about conn.str on the web, but it doesn't work for ms sql 2000.
    http://www.connectionstrings.com/?carrier=sqlserver

    here is configuration of my MS SQL Server 2000
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MS SQL 2000, remote connection

    This looks wrong:
    Code:
    "Data Source=192.36.66.139,1433;
    Should probably be this:

    Code:
    "Data Source=192.36.66.139:1433;
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 1999
    Location
    Poland
    Posts
    278

    Re: MS SQL 2000, remote connection

    thanks for replay,

    Code:
    Data Source = 192.36.66.139:1433
    it throw new error "Specified SQL Server 192.36.66.139:1433 not found"

  4. #4
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    304

    Re: MS SQL 2000, remote connection

    You may want to have a look at this. And have you applied all the service packs?

  5. #5
    Join Date
    Jul 1999
    Location
    Poland
    Posts
    278

    Re: MS SQL 2000, remote connection (fixed issue)

    thanks for help.

    I found the solution.

    The problem wasn't in my ConnectionString but there was a bug in MS SQL 2000 SP3.



    1. I downloaded the last SP ( MS SQL 2000 SP4 , http://www.microsoft.com/downloads/d...displaylang=en

    2. install as follows:

    setup SAPWD="password" SECURITYMODE=SQL DISABLENETWORKPROTOCOLS=0

    3. go to FIREWALL settings ->Exceptions->Add New Port:
    app_name
    port_number (default is 1433)

    4.
    modify connectionString
    Code:
    Sqlconnection tcpConn;
    // example
    tcpConn = "Data Source=192.168.1.101,1433;Network Library=DBMSSOCN;Initial Catalog=" + db_name + ";User ID=sa;Password=";
    // ... 
    it works perfect.

  6. #6
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    304

    Re: MS SQL 2000, remote connection

    That's why I asked in my previous post if you have applied all service packs since similar cases existed wherein applying SP4 just solved their problems. Glad it worked for you also.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured