Quantcast
Channel: MySQL Forums - Connector/ODBC
Viewing all 1136 articles
Browse latest View live

unhandled error from mysql_next_result() when calling stored procedure from ODBC (1 reply)

$
0
0
Hello everyone, I am developing a .NET website using Framework 4.0 and the ODBC connector to MySQL. (For some reason I couldn't find how to use the Connector\net with datasource objects, but that is for another post).

I am calling a stored procedure with one input parameter and two output parameters. When calling it from MySQL workbench it works as expected, but when calling it from my .net project it gives the error below.

So here is the .net code:
OdbcConnection o = new OdbcConnection(ConfigurationManager.ConnectionStrings["CervezaPro"].ToString());
o.Open(); //Se abre la conexión a base de datos
OdbcCommand oc = o.CreateCommand();
oc.CommandType = CommandType.StoredProcedure;
oc.CommandText = "{ CALL CongelarProceso(?,?,?) }";
oc.Parameters.AddWithValue("p_idRecetas", DDLReceta.SelectedValue);
OdbcParameter mensaje = new OdbcParameter("p_mensaje", OdbcType.VarChar,2000);
mensaje.Direction = ParameterDirection.Output;
OdbcParameter resultado = new OdbcParameter("p_resultado", OdbcType.Int);
resultado.Direction = ParameterDirection.Output;
oc.Parameters.Add(mensaje);
oc.Parameters.Add(resultado);
oc.ExecuteNonQuery();

And this is the stored procedure:
CREATE DEFINER=`root`@`localhost` PROCEDURE `CongelarProceso`(in p_idRecetas int, out p_Mensaje varchar(2000), out p_resultado int)
BEGIN
DECLARE done INT DEFAULT FALSE;
dECLARE vStatus int;
declare vDescripcion varchar(100);
declare vEtapa, vIniciocicLo, vFinciclo, vInsumo1, vCantidadProceso, vInsumo2, vCantidadReceta int;
Declare cProceso cursor for select etapaproceso, iniciociclo, finciclo
from procesoelaboracion where recetas_encabezado_idRecetas = p_idRecetas
order by etapaproceso;
Declare cDiscrepancias cursor for SELECT
*
FROM
(SELECT
insumomateriaprima insumos_idinsumos,
SUM(cantidadprocesoanadir) * REPETICIONES_PROCESO(pe.recetas_encabezado_idrecetas, pe.etapaproceso) cantidadproceso
FROM
MateriaPrimaProceso mp, procesoelaboracion pe, insumos i
WHERE
mp.procesoelaboracion_idprocesoelaboracion = pe.idprocesoelaboracion
AND mp.insumomateriaprima = i.idinsumos
AND i.descripcion <> 'Instrucción Especial'
AND pe.recetas_encabezado_idrecetas = p_idRecetas
GROUP BY insumomateriaprima) proceso
LEFT JOIN
(SELECT
insumos_idinsumos, cantidad
FROM
recetas_detalle
WHERE
recetas_encabezado_idrecetas = p_idRecetas) recetas ON proceso.insumos_idinsumos = recetas.insumos_idinsumos
WHERE
recetas.insumos_idinsumos IS NULL
OR recetas.cantidad <> proceso.cantidadproceso
UNION SELECT
*
FROM
(SELECT
insumomateriaprima insumos_idinsumos,
SUM(cantidadprocesoanadir) * REPETICIONES_PROCESO(pe.recetas_encabezado_idrecetas, pe.etapaproceso) cantidadproceso
FROM
MateriaPrimaProceso mp, procesoelaboracion pe, insumos i
WHERE
mp.procesoelaboracion_idprocesoelaboracion = pe.idprocesoelaboracion
AND mp.insumomateriaprima = i.idinsumos
AND i.descripcion <> 'Instrucción Especial'
AND pe.recetas_encabezado_idrecetas = p_idRecetas
GROUP BY insumomateriaprima) proceso
RIGHT JOIN
(SELECT
insumos_idinsumos, cantidad
FROM
recetas_detalle
WHERE
recetas_encabezado_idrecetas = p_idRecetas) recetas ON proceso.insumos_idinsumos = recetas.insumos_idinsumos
WHERE
proceso.insumos_idinsumos IS NULL
OR recetas.cantidad <> proceso.cantidadproceso;
set vStatus = 0;
set p_Mensaje = '';
set p_resultado = 0;
open cProceso;
begin
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
lectura: loop
fetch cProceso into vEtapa, vIniciociclo, vFinciclo;
if done then
LEAVE lectura;
end if;
if vInicioCiclo = 1 then
if vStatus = 1 then
set p_mensaje = concat(p_Mensaje,'\nSe detectó un inicio de ciclo sin que se haya cerrado el ciclo anterior en la etapa: ', vEtapa);
set p_resultado = -1;
else
set vStatus = 1;
end if;
end if;
if vFinCiclo = 1 then
if vStatus = 0 then
set p_Mensaje = concat(p_Mensaje,'\nSe detectó un fin de ciclo sin un inicio de ciclo correspondiente en la etapa: ', vEtapa);
set p_Resultado = -1;
leave lectura;
else
set vStatus = 0;
end if;
end if;
END LOOP;
end;
if vStatus = 1 then
set p_Mensaje = concat(p_Mensaje,'\nSe detectó un inicio de ciclo sin cerrar en el proceso.');
set p_Resultado = -1;
end if;
open cDiscrepancias;
begin
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
set done = false;
lecturad:Loop
fetch cDiscrepancias into vInsumo1, vCantidadProceso, vInsumo2, vCantidadReceta;
if done then
LEAVE lecturad;
end if;
SELECT
descripcion
INTO vDescripcion FROM
insumos
WHERE
idinsumos = vInsumo1;
set p_Mensaje = concat(p_Mensaje, '\nInsumo: ',vDescripcion, ' Cantidad en proceso: ', vCantidadProceso, ' Cantidad en receta: ', vCantidadReceta);
set p_resultado = -1;
end loop;
end;
if p_resultado = 0 then
UPDATE procesoelaboracion
SET
congelarproceso = 1
WHERE
recetas_encabezado_idrecetas = p_idRecetas;
end if;
END

And finally, this is the error that appears when executing from .NET:
Server Error in '/' Application.

ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
(The line repeats an uncountable amount of times)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
(this line again repeats too many times)

Source Error:



Line 184: oc.Parameters.Add(mensaje);
Line 185: oc.Parameters.Add(resultado);
Line 186: oc.ExecuteNonQuery();


Stack Trace:



[OdbcException (0x80131937): ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()
ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.30]unhandled error from mysql_next_result()

(line again repeats)

System.Data.Odbc.OdbcDataReader.NextResult(Boolean disposing, Boolean allresults) +1056179
System.Data.Odbc.OdbcDataReader.Close(Boolean disposing) +52
System.Data.Odbc.OdbcDataReader.Close() +11
System.Data.Odbc.OdbcCommand.ExecuteScalar() +140
ProcesoElaboracion.ButCongelar_Click(Object sender, EventArgs e) in c:\Users\shinaco\Documents\Visual Studio 2015\WebSites\HelloWorld\Cerveza\ProcesoElaboracion.aspx.cs:186
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9692746
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3562

Any help regarding this would be very much appreciated

ODBC 5.3 MySQL Configuration Window (no replies)

$
0
0
How can I stop the Configuration window from popping up when the connection attempt in my program fails? (it suppresses a needed window in my program from being accessed).
Steve

Access 2002 Forgetting mySQL login info (no replies)

$
0
0
Connector: ODBC5.1

I am running Access 2002 on Server 2003 and for the better part of a year my ODBC connection to a remote mySQL database worked perfectly.

One day it started making me re-enter the User: and Password: once after each time my database application was restarted.

More recently, it started randomly forgetting this info without the application even being restarted. In this case, inputting just the User: field seems to make it resume the connection.

I have uninstalled and re-installed the 5.1 connector but the problem persists. I tried installing the latest ODBC connector but for some reason it will not install on my server.

Has anyone experienced this problem and if so were you able to solve the issue?

Solaris 9 ODBC Driver (1 reply)

$
0
0
Hi

Can someone tell me what the latest ODBC driver for Solaris 9 is? We are using mysql-connector-odbc-3.51.27-solaris9-sparc-64bit but are having issues using it with Data Services Data Integrator.

Thanks

ODBC Connector for Yosemite 10.10.5 -- installation problem (no replies)

$
0
0
I run the .dmg My SQL ODBC Connector for Yosemite 10.10, and when is in the package validation step it sends me an error.

"Error during the instalation. The installer has detected an error that preclude the installation. Please contact the software fabricant."

Anyone knows whats going wrong?

Thank you,
Gastón.
Chile

Win7 32bit programmatic DSN creation causing Exception (1 reply)

$
0
0
I am trying to add a DSN from a C#.Net application.

I am using the following,
SQLConfigDataSource from ODBCCP32.dll

When calling, I receive a System.AccessViolationException

I don't receive this exception when using a different driver (such as "Sql Server")

Also worth noting, is that if I remove myodbc5S.* from the mysql connector directory this exception no longer happens and the call executes and returns an odbc error:
ODBC Error <ODBC_ERROR_LOAD_LIB_FAILED>: The setup routines for the MySQL ODBC 5.3 ANSI Driver ODBC driver could not be loaded due to system error code 126: The specified module could not be found. (C:\VPD3\VPD3 Database\5.3.6-win32\myodbc5S.dll).

From what I can tell the myodbc5s.* files support the GUI part of making a DSN connection.

Is there a way to turn this feature off? Has anyone else had a problem with this?

myodbc5a.dll missing (1 reply)

$
0
0
Hello,

I really need some help in installing ODBC driver. When I tried to set up the driver using Server Instance Configuration Wizard the connection was unsuccessful.

I am no longer able to open up this Wizard and when I try to execute SQL from Excel it keeps saying myodbc5a.dll missing "module not found".

Can anyone help me please?

Thank you,
Rashida

SUM Function does not exists (1 reply)

$
0
0
I am using mysql 5.5.11, when i execute the script below

INSERT INTO payments(created, Amount, user, Remarks, orderid, paymethod)
VALUES('2016-09-03', 0.0, 'admin', '', 4, 'Cash');

I get error

SQL Error: FUNCTION mydb.SUM does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual


This is the table schema

CREATE TABLE payments (
ID int AUTO_INCREMENT NOT NULL,
OrderID int,
Amount decimal(11,2),
Created varchar(20),
Remarks varchar(160),
user varchar(60),
PayMethod varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci,
/* Keys */
PRIMARY KEY (ID)
) ENGINE = InnoDB;

cells are truncated when connecting ODBC to third party software (no replies)

$
0
0
Hi All,

Connecting Alteryx software to our database using an ODBC connector (64bit). Using a pre-written SQL statement I am attempting to query customer feedback. I've noticed that when reporting straight from MySql (connecting straight to our database) the verbatim is full and complete.

However, when reporting the same query through the ODBC connector, the verbatim is truncated.

Is there a way I can specify my ODBC connector to not truncate? Or is there perhaps something I'm doing wrong?

Appreciate the help.

Error 10061 (1 reply)

$
0
0
Hi everybody,
i am totally new in SQL.
I need to comunicate from labview to sql.
I am trying to create an odbc data source configuration.
But when i press "Test" button it gives to me this error [MySQL][ODBC5.3 Driver] Can't Connect to MySQL Server on 'localhost' (10061)

How can i do?!

MySQL ODBC 5.3 Unicode Driver Installation fails (no replies)

$
0
0
Hi,

I have a Windows 7 - 64 bit machine. I am trying to install MySQL ODBC 5.3 Unicode Driver but the installation gets interrupted with the below error

"Error 1918. Error installing ODBC driver MySQL ODBC 5.3 ANSI Driver, ODBC error 13: Could not load the setup or translator library. Verify that the file MySQL ODBC 5.3 ANSI Driver exists and that you can access it."

I have got the below 2 possible solutions from internet, tried both of them but still the error is popping up

1) Install Visual C++ 2010/2013 Redistributable – Done
2) Make sure msvcr100.dll is available in System32 and SysWOW64 – Checked. File is available

Please help.

Thanks

How do I access JSON datatype from ODBC? (1 reply)

$
0
0
When I try to collect the data type, it appears as SQL_UNKNOWN. The size given is not consistent with what is stored in the database.

Can the data be accessed as a CLOB?

What is the way to programatically access the data.

Excel vba ADODB with MySQL (1 reply)

$
0
0
Hi I need to connect to a MySQL DB from excel, I found this example:

http://forums.mysql.com/read.php?10,100302

modify it to my requirements, but at the time of run it does nothing, nor it gives me error.

==================================================
Option Explicit
Option Base 1

Sub excelmysql()
' VBA to perform various actions on MySQL tables using VBA
' Majority of the original code adapted from Carlmack http://www.ozgrid.com/forum/showthread.php?t=46893

' PLEASE DO THE FOLLOWING BEFORE EXECUTING CODE:
' 1)In VBE you need to go Tools/References and check Microsoft Active X Data Objects 2.x library
' 2)Install MySQL ODBC 3.51 Driver. See dev.mysql.com/downloads/connector/odbc/3.51.html or google "MySQL ODBC 3.51 Driver"

'-------------------------------------------------------------------------
' Connection variables
Dim conn As New ADODB.Connection
Dim server_name As String
Dim database_name As String
Dim user_id As String
Dim password As String

' Table action variables
Dim i As Long ' counter
Dim sqlstr As String ' SQL to perform various actions
Dim table1 As String, table2 As String
Dim field1 As String, field2 As String
Dim rs As ADODB.Recordset
Dim vtype As Variant

'----------------------------------------------------------------------
' Establish connection to the database
server_name = "127.0.0.1" ' Enter your server name here - if running from a local computer use 127.0.0.1
database_name = "pruebas" ' Enter your database name here
user_id = "prueba" ' enter your user ID here
password = "12345678" ' Enter your password here

Set conn = New ADODB.Connection
conn.Open "DRIVER={MySQL ODBC 3.51 Driver}" _
& ";SERVER=" & server_name _
& ";DATABASE=" & database_name _
& ";UID=" & user_id _
& ";PWD=" & password _
& ";OPTION=16427" ' Option 16427 = Convert LongLong to Int: This just helps makes sure that large numeric results get properly interpreted

'---------------------------------------------
' Extract MySQL table data to first worksheet in the workbook
GoTo skipextract
Set rs = New ADODB.Recordset
sqlstr = "select dato1 from datos where IdDato=1" ' extracts all data
rs.Open sqlstr, conn, adOpenStatic
With Worksheets("Hoja1").Cells("A1") ' Enter your sheet name and range here
.ClearContents
.CopyFromRecordset rs
End With
skipextract:

'-----------------------------------------------------------------------
' Close connections
On Error Resume Next
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
On Error GoTo 0
End Sub
=============================================

I much appreciate your attention and time.

Best regards.

Trouble with ODBC (1 reply)

$
0
0
Using FileMaker Pro I have set up an ODBC Data connection to MySQL. The connection works but the transfer of files is extremely slow and the record count (which starts) at the correct number gradually decreases and leaves with with only 7 records after a few minutes?

Cannot install Connector/ODBC 5.3.6 on Sierra 10.12.1 (7 replies)

$
0
0
Hello
I'm trying to install Connector/ODBC 5.3.6 on my iMAc running OSX 10.12.1
The installation dialogue box says it will install in /Applications/Utilities/ODBC Administrator.app
However, although I'm told at the end that the installation was successful, there is no ODBC Administrator in the Utilities folder.
I don't understand what (if anything) I'm doing wrong and I'd be very grateful for some guidance.
Nicholas

Cannot open firstm but can second time (1 reply)

$
0
0
Hello!

My customer use the Connector/ODBC 5.3.6 for Windows x84.
https://dev.mysql.com/downloads/connector/odbc/
The ODBC is used to connect to a MySQL running on another machine.

The customer have configured an MySQL ODBC 5.3 Unicode Driver in Window's ODBC configuration tool at C:\Windows\SysWOW64\odbcad32.exe.
This window is displayed to configure the ODCB-connection: https://dev.mysql.com/doc/connector-odbc/en/images/myodbc-win-odbcadmin-adddsn-5-1.png

When the customer press the "Test" button the connection fails. But when pressed again the connection is successful and the possible databases/schemas can be shown in the configuration tool.


In my application where the ODBC-connection is used, the application crashes when trying to open the connection the first time. When trying to open again, the connection is established.

The exception which was thrown has this error message:
"ERROR [HY000] [MySQL][ODBC 5.3(w) Driver]Can't connect to MySQL server on '10.205.210.65' (10060)"


In sequence this happens:

Open() // Fails with the above exception.
Open() // Works

My customer have verified the connection to the MySQL-server on the remote machine with the MySQL Workbench. There is no problems with any permissions or network. Everything works except for first time when the connection should be established.

What could be the problem?


Best regards,
/Steffe

Optional Featrue Not Implemented (1 reply)

$
0
0
Windows 10
MySQL 5.7.9
MySQL ODBC Driver 3.51 32-bit
OpenOffoce 4.1.3
JRE 1.8.0_73 Installed

I have a good ODBC connection to a MySQL database on a remote server at Lunar Pages.
The connection works perfectly using MS Access 2K.

Opening up Base, I can "see" the database with all the tables listed.

Attempts to retrieve data by Linking to a list box or simply clicking on any of the tables gets this error message:

The Data Content Could Not Be Loaded
[MySQL][ODBC Driver][mysqld-5.6.27-75.0]Optional feature not implemented.

But if I create a SQL query to retrieve only one column, it works.

So I presume that an ODBC connection through OpenOffice needs "something else" that is either unnecessary or native in MS Access.

If you click "More" to learn about the error, you see:
SQL Status: HYC00
Error Code: 537

So the questions are: What optional feature? And how do I implement it?

Could this be related to Windows 10?

I've put these same questions to the OpenOffice forum, so far without success.

Any suggestions appreciated.

primary key detection w/odbc 5.3 ansi (no replies)

$
0
0
Hello friends -

Working with a data modification tool that uses odbc connections. Trying to talk to a 5.6 database using odbc 5.3 ansi. Reading and first time inserts work great. If I ask the tool to 'update, insert if new', I get primary key violations thrown back up; i.e., it's seems unable to tell that row identifier x exists, and tries a duplicate insert.

Vendor is blaming the ODBC driver implementation, which is consistent with the fact that if I change my target database to sql server, I see acceptable results. That being said, I'm curious if others have seen problems with primary key identification using odbc 5.3. I did see a SO thread regarding the sun jdbc:odbc bridge indicating DatabaseMetada.getPrimaryKeys() was not implemented, but I could not find anything else in Google land to validate that if this was a failing of the standard odbc driver.

Any insight is appreciated.

Cannot install Connector/ODBC 5.3.6 in OS X 10.11 (1 reply)

$
0
0
Hi,
cannot install the connector in OS X 10.11. Last step in the wizard is failing with no error info.

Any help is welcome,
fernando

Unable to connect from one PC (1 reply)

$
0
0
We have an MYSQL database which we have linked the Tables in an Access Database using the ODBC. I have installed and configured the ODBC in several computers and they all work fine. I have this one computer which I have configured the same way. I created the same ODBC connection in the Control Panel and test connection is successful. However when I open the access and try to read from the linked table I get an error "Run-time error 3151 ODBC-- connection to ... failed. I tried logging in with the Admin user but same thing. I can't figure out what could be different on this computer. I don't know where to look. Is there any logging that might help find the issue.

Thanks,
Sam
Viewing all 1136 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>