MySQL command issues with an ADO Recordset

Hi All

I know you will probably say that I should use MS SQL Server DBs with ASP,
but my MySQL and ASP combo works and is affordable for me and up until now
didn't give me any grief until recently.

In essence, the following MySQL query commands cause my ASP to generate a
Type Mismatch error when I try to response.write the result of the query
fields:

Query 1

CONCAT(PICFILEWIDTH,' x ',PICFILEHEIGHT)

I call this query result into a dynamically-created array from a recordset
object, ie arrSQLData (the array) = oRSv.GetRows() (the recordset object),
but when I call say arrSQLData(0,0) it generates the type mismatch.

This used to work fine in the MySQL v4 something that had the crappy
installer, but since they made the new installer (and some other mods) it
causes this problem.

I've checked the MySQL site and it says that the above, which is an int, ' x
', another int is fine, but something in ASP doesn't like the result it
sends back.

Done a straight query from SQLyog and that displays it OK.

Query 2

IFNULL((sp.RRPTAX/sp.RRPNET),'0.00')

same again this generates a type mismatch when it used to work fine.
Obviously the command puts in 0.00 if the tax and net values are null, but
this doesn't work now. It generates a type mismatch.

Has anybody had this problem and fixed it?

Thanks

Laphan
Laphan [ Do, 02 November 2006 22:17 ] [ ID #1521887 ]

Re: MySQL command issues with an ADO Recordset

Laphan wrote:

> Hi All
>
> I know you will probably say that I should use MS SQL Server DBs with ASP,
> but my MySQL and ASP combo works and is affordable for me and up until now
> didn't give me any grief until recently.
>
> In essence, the following MySQL query commands cause my ASP to generate a
> Type Mismatch error when I try to response.write the result of the query
> fields:
>
> Query 1
>
> CONCAT(PICFILEWIDTH,' x ',PICFILEHEIGHT)
>
> I call this query result into a dynamically-created array from a recordset
> object, ie arrSQLData (the array) = oRSv.GetRows() (the recordset object),
> but when I call say arrSQLData(0,0) it generates the type mismatch.
>
> This used to work fine in the MySQL v4 something that had the crappy
> installer, but since they made the new installer (and some other mods) it
> causes this problem.
>
> I've checked the MySQL site and it says that the above, which is an int, ' x
> ', another int is fine, but something in ASP doesn't like the result it
> sends back.
>
> Done a straight query from SQLyog and that displays it OK.
>
> Query 2
>
> IFNULL((sp.RRPTAX/sp.RRPNET),'0.00')
>
> same again this generates a type mismatch when it used to work fine.
> Obviously the command puts in 0.00 if the tax and net values are null, but
> this doesn't work now. It generates a type mismatch.
>
> Has anybody had this problem and fixed it?
>
> Thanks
>
> Laphan
>
>
>
>
try:

CONCAT(cast(PICFILEWIDTH as varchar),' x ',cast(PICFILEHEIGHT as varchar))

Basically you are trying to use a function (CONCAT) that is character-datatype
based with an integer datatype.


--
Michael Austin.
:)
Michael Austin [ Sa, 04 November 2006 20:41 ] [ ID #1524270 ]

Re: MySQL command issues with an ADO Recordset

Thanks Michael

Do you have any ideas as to what is happening with the ifnull?

Rgds

Laphan

"Michael Austin" <maustin [at] firstdbasource.com> wrote in message
news:p163h.1558$Mw.615 [at] newssvr11.news.prodigy.com...
Laphan wrote:

> Hi All
>
> I know you will probably say that I should use MS SQL Server DBs with ASP,
> but my MySQL and ASP combo works and is affordable for me and up until now
> didn't give me any grief until recently.
>
> In essence, the following MySQL query commands cause my ASP to generate a
> Type Mismatch error when I try to response.write the result of the query
> fields:
>
> Query 1
>
> CONCAT(PICFILEWIDTH,' x ',PICFILEHEIGHT)
>
> I call this query result into a dynamically-created array from a recordset
> object, ie arrSQLData (the array) = oRSv.GetRows() (the recordset object),
> but when I call say arrSQLData(0,0) it generates the type mismatch.
>
> This used to work fine in the MySQL v4 something that had the crappy
> installer, but since they made the new installer (and some other mods) it
> causes this problem.
>
> I've checked the MySQL site and it says that the above, which is an int, '
> x
> ', another int is fine, but something in ASP doesn't like the result it
> sends back.
>
> Done a straight query from SQLyog and that displays it OK.
>
> Query 2
>
> IFNULL((sp.RRPTAX/sp.RRPNET),'0.00')
>
> same again this generates a type mismatch when it used to work fine.
> Obviously the command puts in 0.00 if the tax and net values are null, but
> this doesn't work now. It generates a type mismatch.
>
> Has anybody had this problem and fixed it?
>
> Thanks
>
> Laphan
>
>
>
>
try:

CONCAT(cast(PICFILEWIDTH as varchar),' x ',cast(PICFILEHEIGHT as varchar))

Basically you are trying to use a function (CONCAT) that is
character-datatype
based with an integer datatype.


--
Michael Austin.
:)
Laphan [ Do, 09 November 2006 21:27 ] [ ID #1529550 ]
Datenbanken » mailing.database.mysql » MySQL command issues with an ADO Recordset

Vorheriges Thema: which storage engine should I use- MyISAM or InnoDB?
Nächstes Thema: storage optimization for read-only table