Coder Social home page Coder Social logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
I was able to figure out the reason for the

"[iODBC][Driver Manager]Data source name not found and no default driver 
specified. Driver could not"

error.I added the proper odbc.ini and odbcinst.ini but the original decode 
error still persists.

This call from pypyodbc.py is failing 

try:
                lock.acquire()
                ret = odbc_func(self.dbc_h, 0, c_connectString,len(self.connectString), None, 0, None, SQL_DRIVER_NOPROMPT)

            finally:
                lock.release()


The ret value is -1 which corresponds to SQL_ERROR. And the odbc_func is 
"ODBC_API.SQLDriverConnectW"




Original comment by [email protected] on 19 Dec 2013 at 12:56

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
Also I further added debugging to identify the type of specific sql state we 
were seeing.
Since we seem to be going through the non ansi part right before calling the 
above odbc_connect function looking at the rest of your file I added this


try:
                lock.acquire()
                ret = odbc_func(self.dbc_h, 0, c_connectString, len(self.connectString), None, 0, None, SQL_DRIVER_NOPROMPT)
                if ret == SQL_ERROR:
                        stateE = create_buffer_u(22)
                        MessageE = create_buffer_u(1024*4)
                        ODBC_funcE = ODBC_API.SQLGetDiagRecW
                        raw_sE = unicode
                        NativeErrorE = ctypes.c_int()
                        Buffer_lenE = c_short()
                        val = ODBC_funcE(SQL_HANDLE_DBC, self.dbc_h,1, stateE,ADDR(NativeErrorE), MessageE, 1024, ADDR(Buffer_lenE))
                        print val
                        print MessageE.value
            finally:
                lock.release()


The value of 'val' printed is 0.And MessageE.value is '['.StateE.value is 0. 
NativeErrorE.value is 20013(but I dont find any interpretation for that here?)

Does the implementation of ODBC_API.SQLGetDiagRecW here look correct?




Original comment by [email protected] on 19 Dec 2013 at 1:58

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
I get the exact same issue as well.

See: https://gist.github.com/therealprologic/5ce32e33c8f51d8bf01b

Original comment by [email protected] on 2 Jul 2014 at 1:06

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
Although this specific error above goes away when I:

brew install unixodb

But then I get a different error:

https://gist.github.com/therealprologic/5ce32e33c8f51d8bf01b#comment-1256068

Original comment by [email protected] on 2 Jul 2014 at 1:10

from pypyodbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.