Stored Queries in Access. .ASP VbScript
Hi all.
Just whent from MX2004 to CS4
So i have an Access DB.
There is a stored Querie called :
sqCarAllInfoByProdDate
The Sql for the Querie :
SELECT tblCar.Id, tblCar.Vin, tblCar.ChassiName, tblCar.Series, tblCar.SteeringWheel, tblCar.Doors, tblCar.EngineBoor, tblCar.Hp, tblCar.ProdDate, tblEngineType.EngineType, tblExtColor.ExtColorTxt, tblGearBox.GearBox, tblIntUpHolstery.*, tblTransmision.Transmision, tblType.Typee, tblTypeCode.TypeCode
FROM tblTypeCode INNER JOIN (tblType INNER JOIN (tblTransmision INNER JOIN (tblIntUpHolstery INNER JOIN (tblGearBox INNER JOIN (tblExtColor INNER JOIN (tblEngineType INNER JOIN tblCar ON tblEngineType.Id = tblCar.EngineType) ON tblExtColor.ExtColorCode = tblCar.Color) ON tblGearBox.Id = tblCar.GearBox) ON tblIntUpHolstery.IntUpHolsteryCode = tblCar.IntUpHolstery) ON tblTransmision.Id = tblCar.Transmision) ON tblType.Id = tblCar.Typee) ON tblTypeCode.Id = tblCar.TypeCode
WHERE (((tblCar.SteeringWheel)=[@Steering]) AND ((tblCar.ProdDate) Between [@StartDate] And [@EndDate]))
ORDER BY tblCar.ProdDate;
When i try the SQL directly in CS4 (just edit the Variable names offcourse) it works fine.
But i I do :
EXEC sqCarAllInfoByProdDate Steering, EndDate, StartDate
Hit Test, it works. But upload and run on the server gives error :
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
/forum/e34m5all.asp, line 37
<%
Dim rsAllByProdDate
Dim rsAllByProdDate_cmd
Dim rsAllByProdDate_numRows
Set rsAllByProdDate_cmd = Server.CreateObject ("ADODB.Command")
rsAllByProdDate_cmd.ActiveConnection = MM_connM5_STRING
rsAllByProdDate_cmd.CommandText = "EXEC sqCarAllInfoByProdDate ?, ?, ?"
rsAllByProdDate_cmd.Prepared = true
rsAllByProdDate_cmd.Parameters.Append rsAllByProdDate_cmd.CreateParameter("param1", 200, 1, 255, rsAllByProdDate__Steering) ' adVarChar
rsAllByProdDate_cmd.Parameters.Append rsAllByProdDate_cmd.CreateParameter("param2", 135, 1, -1, rsAllByProdDate__EndDate) ' adDBTimeStamp
rsAllByProdDate_cmd.Parameters.Append rsAllByProdDate_cmd.CreateParameter("param3", 135, 1, -1, rsAllByProdDate__StartDate) ' adDBTimeStamp
Line 37 : Set rsAllByProdDate = rsAllByProdDate_cmd.Execute
rsAllByProdDate_numRows = 0
%>
But as to my settings the data types match, and it also works with "Test" button
What's up with this???
Anyone
