I'm getting the following error when I attempt to pass a parameter (via an ASP page) with a decimal data type to a SQL Server 2000 stored procedure:
Microsoft OLE DB Provider for SQL Server error '80004005'
The precision is invalid.
Here's my ASP code:
set cmd = server.CreateObject ("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandText = "sp_Name"
cmd.CommandType = 4
cmd.Parameters.Append(cmd.CreateParameter ("LATITUDE",adDecimal,adParamInput,,Cdbl(vLatitude)))
cmd.Parameters.Append(cmd.CreateParameter ("LONGITUDE",adDecimal,adParamInput,,Cdbl(vLongitude)))
I've also tried:
cmd.Parameters.Append(cmd.CreateParameter ("LATITUDE",adDecimal,adParamInput,(8,4),Cdbl(vLatitude)))
cmd.Parameters.Append(cmd.CreateParameter ("LONGITUDE",adDecimal,adParamInput,(8,4),Cdbl(vLongitude)))
Here is my stored procedure code:
CREATE PROCEDURE [DBO].[sp_Name]
@LATITUDE DECIMAL(8,4),
@LONGITUDE DECIMAL(8,4)
AS
SELECT *
FROM TABLE
WHERE LONGITUDE = @LONGITUDE
AND LATITUDE = @LATITUDE
In the table:
LATITUDE DECIMAL(8,4) LENGTH = 5
LONGITUDE DECIMAL (8,4) LENGTH = 5
Has anyone encountered this problem?
Microsoft OLE DB Provider for SQL Server error '80004005'
The precision is invalid.
Here's my ASP code:
set cmd = server.CreateObject ("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandText = "sp_Name"
cmd.CommandType = 4
cmd.Parameters.Append(cmd.CreateParameter ("LATITUDE",adDecimal,adParamInput,,Cdbl(vLatitude)))
cmd.Parameters.Append(cmd.CreateParameter ("LONGITUDE",adDecimal,adParamInput,,Cdbl(vLongitude)))
I've also tried:
cmd.Parameters.Append(cmd.CreateParameter ("LATITUDE",adDecimal,adParamInput,(8,4),Cdbl(vLatitude)))
cmd.Parameters.Append(cmd.CreateParameter ("LONGITUDE",adDecimal,adParamInput,(8,4),Cdbl(vLongitude)))
Here is my stored procedure code:
CREATE PROCEDURE [DBO].[sp_Name]
@LATITUDE DECIMAL(8,4),
@LONGITUDE DECIMAL(8,4)
AS
SELECT *
FROM TABLE
WHERE LONGITUDE = @LONGITUDE
AND LATITUDE = @LATITUDE
In the table:
LATITUDE DECIMAL(8,4) LENGTH = 5
LONGITUDE DECIMAL (8,4) LENGTH = 5
Has anyone encountered this problem?