MySQL command issues with an ADO Recordset
MySQL command issues with an ADO Recordset
am 02.11.2006 22:17:46 von Laphan
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
Re: MySQL command issues with an ADO Recordset
am 04.11.2006 20:41:09 von Michael Austin
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.
:)
Re: MySQL command issues with an ADO Recordset
am 09.11.2006 21:27:27 von Laphan
Thanks Michael
Do you have any ideas as to what is happening with the ifnull?
Rgds
Laphan
"Michael Austin" wrote in message
news:p163h.1558$Mw.615@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.
:)