Menu

Could Not Connect to MS Sql Server

N@vEeD
2007-02-13
2013-04-29
  • N@vEeD

    N@vEeD - 2007-02-13

    Hi Guyz
    I am connecting Python with Sql Server 2000 using pymssql-0.8.0 and I am tired of this error

    _mssql.error : could not Connect to MS SQL Server

    My Code is below

    import pymssql
    con = pymssql.connect("username","password","IP OF SERVER","Database Name")

    Please tell me what is the Problem...

    Regards,
    Naveed Khan

     
    • Sebastian Auriol

      It's some kind of network problem, I expect: Either you have the IP of the server wrong, the connection is being blocked by a firewall, SQL Server is not running on the server, or it is running on a non-standard port, or something of this sort.

       
    • N@vEeD

      N@vEeD - 2007-02-15

      Thanks  Sebastian Auriol for your response

      Actually thing is that.. I am running ASTERISK SERVER and to control my Dial Plan I am using Python...THe Asterisk Server is Running Vritually on my Windows Machine and I am using VMWARE to run asterisk...(Means that both the systems are running on a same machine at a same time)

      One of the guyz told me that ODBC will not comunicate in this situation and to solve this problem we need 2 Ethernet cards dedicated to each systems (Windows and Asterisk).. THen it will be fine..

      I personnaly didn't implemented this But i am looking into it..

      If you have any suggesions please tell

       
      • Sebastian Auriol

        It seems a bit unlikely to me that you should require two network cards in order for your virtual machine to communicate to your host machine. But I haven't tried and I suppose this person may be right.

        You could maybe run Python and pymssql on your host machine though if it is possible to share files between them - or you could use FastAGI, but that's probably more complicated then you wanted.

         
    • N@vEeD

      N@vEeD - 2007-02-15

      Good thing is that .. THe error has been changed to "I don't know how"

      When I am connecting to Sqlserver it is saying

      error: DB-Lib error message 20017, severity 9:
      Unexpected EOF from the server
      DB-Lib error message 20002, severity 9:
      Adaptive Server connection failed

      Do you have any idea what is the problem

      Regards,
      Naveed

       
      • Sebastian Auriol

        Are you using FreeTDS?  Have you set it to use version 8.0 (in freetds.conf)?

         
    • N@vEeD

      N@vEeD - 2007-02-15

      Yes I am using FREETDS and  I have changes the Conf file as

      [global]
              # TDS protocol version
          tds version = 8.0

      I have restarted the system but still the error is same

       
    • N@vEeD

      N@vEeD - 2007-02-15

      i checked the server log at find that

      Error:17832, Severity:20, State: 7
      Connection open but invalid login packet(s) send. Connection Closed

      WHAT IS THIS? ANd why its occuring?

       
      • Sebastian Auriol

        I suggest adding something like this to freetds.conf:
        dump file = /tmp/freetds.log
        debug level = 10
        And then having a look in the FreeTDS logs.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.