>>>>> "Mike" == Mike McCauley <mikem@stripped> writes:
Mike> Heres a little perl program that demonstrates an apparent problem with
Mike> myodbc-2.50.22 on NT.
Mike> This progrem creates a UDP socket, connects to a mySQL database through
Mike> DBI/DBD-ODBC/myODBC to mysql-shareware-win32-1.1.zip on NT. No queries are
Mike> issued. When the program attempts to send() on the UDP socket, it gets an
Mike> "unknown error" failure. The perl is ActiveState build 516.
Mike> If the socket is opened _after_ connecting to the database instead of before,
Mike> it works fine.
Mike> The problem is the same if its ActiveState build 509.
Mike> Problem is the same when the mysql database is mysql-3.21.33b on a remote
Mike> Solaris instead of the shareware on NT.
Mike> Problem is the same on Windows 98.
Mike> There is no problem with DBD-Sybase, DBD-Oracle, or DBD-ODBC to MSSQL or
Mike> ORACLE, only DBD_ODBC with myODBC fails.
Mike> Problem goes away with myodbc-2.50.19.
Mike> Looks to me like the problem is in myodbc-2.50.22.
Mike> Attached is the script domonstrating the problem, plus the myodbc.log
Mike> Any ideas?
Hi!
The problem is probably how winsockets works on NT/Win98:
MyODBC uses TCP/IP as a protocol between the client and the server (It
may be that Sybase and Oracle doesn't use TCP/IP). To allow this,
MyODBC has to initialise the winsocket library with the following code:
(From mysys/my_init.c)
---------
WSACleanup( ); /* This is needed on some machines */
if (!WSAStartup( wVersionRequested, &wsaData ))
have_tcpip=1;
--------
The WSACleanup() code is added recently as this was needed to get
MyODBC / MySQL to work on some machines.
The problem probably that the WSACleanup() call makes your program
fail, but as I don't know of any way to check if WSACleanup() is
really needed this is VERY hard to fix. (I have checked a lot of
documentation about this, but haven't found any answer to this)
Regards,
Monty