recordset values reset tu null after use as an argument in a function call

recordset values reset tu null after use as an argument in a function call

am 26.03.2008 13:18:44 von Jos Verhoeff

------=_NextPart_000_0065_01C88F43.EB0BD0A0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,



Since I upgraded to MyODBC 3.51.24 (MySQL 5 release running) I have the
following problem in a vb dll that has been running for a number of years
now.



I populate a recordset





Function check(S as string)

Return true or false

End function





Function dosomething

Dim rs

>>Populate rs

Dosomething = ""

If check(rs("fieldname").value) then

dosomething = rs("fieldname").value

End if

End function





At line If y(rs("fieldname").value) then, the value of rs("fieldname") has
a value





At line X = rs("fieldname").value the value is reset to null



The call to function check resets it to null

Check itself does nothing with the field value but analyse its contents

Whether I do byval S or byref S makes no difference.

What does make a difference is the database itself.



I have a number of databases, all with the same structure, and for some this
happens, for some it does not.



With the previous MyODBC versions (3.51.20 I believe) this did not happen,
also not with MySQL 4.0 and 4.1



I can check my code and recompile, but I would like to know what I am
watching for.





Greetings,



Jos Verhoeff






















CERIUM - Internet Technology
Beurs - World Trade Center - Suite 273
Beursplein 37 (bezoekadres)
Postbus 30006
3001 DA Rotterdam

T : 010 2056700
F : 010-2051938
I : www.CERIUM.nl
Alg. @ : info@CERIUM.nl




------=_NextPart_000_0065_01C88F43.EB0BD0A0--

RE: recordset values reset tu null after use as an argument in a function call

am 28.03.2008 05:51:09 von John.Bonnett

I wouldn't pass rs("fieldname").value as an argument to the function.
Grab its value in a local string and pass that. I do agree though that
it should not make any difference.

John Bonnett

-----Original Message-----
From: Jos Verhoeff [mailto:jos@cerium.nl]=20
Sent: Wednesday, 26 March 2008 10:49 PM
To: myodbc@lists.mysql.com
Subject: recordset values reset tu null after use as an argument in a
function call

Hi,

=20

Since I upgraded to MyODBC 3.51.24 (MySQL 5 release running) I have the
following problem in a vb dll that has been running for a number of
years now.

=20

I populate a recordset=20

=20

=20

Function check(S as string)

Return true or false

End function

=20

=20

Function dosomething

Dim rs

>>Populate rs

Dosomething =3D ""

If check(rs("fieldname").value) then

dosomething =3D rs("fieldname").value

End if

End function

=20

=20

At line If y(rs("fieldname").value) then, the value of rs("fieldname")
has a value

=20

=20

At line X =3D rs("fieldname").value the value is reset to null

=20

The call to function check resets it to null

Check itself does nothing with the field value but analyse its contents

Whether I do byval S or byref S makes no difference.

What does make a difference is the database itself.

=20

I have a number of databases, all with the same structure, and for some
this happens, for some it does not.

=20

With the previous MyODBC versions (3.51.20 I believe) this did not
happen, also not with MySQL 4.0 and 4.1

=20

I can check my code and recompile, but I would like to know what I am
watching for.

=20

=20

Greetings,

=20

Jos Verhoeff

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20


CERIUM - Internet Technology
Beurs - World Trade Center - Suite 273
Beursplein 37 (bezoekadres)
Postbus 30006
3001 DA Rotterdam

T : 010 2056700
F : 010-2051938
I : www.CERIUM.nl Alg. @ :
info@CERIUM.nl

=20


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg

RE: recordset values reset tu null after use as an argument in a function call

am 28.03.2008 10:50:08 von Jos Verhoeff

Hi,

The code has been working and for some reason stopped working, but only in
some cases, so I thought I'd share it with this list.
Would there be anything I can do to narrow it down ? There are a lot of this
type of calls in the code. If I do as John suggests, the component (vb dll)
will get a lot bigger.

As I said it does not make a difference whether the variable is coded in the
function as byref or byval.

Could it have something to do with the different (stricter) way recent
versions of MyODBC handles data types ?
The caller sends a recordset value (MySQL data type is varchar) and the
called expects a string value. Could that be it ?

Jos Verhoeff




-----Original Message-----
From: Bonnett, John [mailto:John.Bonnett@vision.zeiss.com]
Sent: vrijdag 28 maart 2008 5:51
To: jos@cerium.nl; myodbc@lists.mysql.com
Subject: RE: recordset values reset tu null after use as an argument in a
function call

I wouldn't pass rs("fieldname").value as an argument to the function.
Grab its value in a local string and pass that. I do agree though that
it should not make any difference.

John Bonnett

-----Original Message-----
From: Jos Verhoeff [mailto:jos@cerium.nl]
Sent: Wednesday, 26 March 2008 10:49 PM
To: myodbc@lists.mysql.com
Subject: recordset values reset tu null after use as an argument in a
function call

Hi,



Since I upgraded to MyODBC 3.51.24 (MySQL 5 release running) I have the
following problem in a vb dll that has been running for a number of
years now.



I populate a recordset





Function check(S as string)

Return true or false

End function





Function dosomething

Dim rs

>>Populate rs

Dosomething = ""

If check(rs("fieldname").value) then

dosomething = rs("fieldname").value

End if

End function





At line If y(rs("fieldname").value) then, the value of rs("fieldname")
has a value





At line X = rs("fieldname").value the value is reset to null



The call to function check resets it to null

Check itself does nothing with the field value but analyse its contents

Whether I do byval S or byref S makes no difference.

What does make a difference is the database itself.



I have a number of databases, all with the same structure, and for some
this happens, for some it does not.



With the previous MyODBC versions (3.51.20 I believe) this did not
happen, also not with MySQL 4.0 and 4.1



I can check my code and recompile, but I would like to know what I am
watching for.





Greetings,



Jos Verhoeff






















CERIUM - Internet Technology
Beurs - World Trade Center - Suite 273
Beursplein 37 (bezoekadres)
Postbus 30006
3001 DA Rotterdam

T : 010 2056700
F : 010-2051938
I : www.CERIUM.nl Alg. @ :
info@CERIUM.nl




--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org