Money data type mapping to ADO

  • Hi, I'm getting a "type mismatch" (line highlighted in red) when creating an input ado parameter.  I am trying to insert a row that contains a money(8) column.  The code to create the parameter is as follows:

    Sub CreateMoneyParam(command, paramName, value)

    dim param

    param = command.CreateParameter(paramName, adCurrency, adParamInput, 8, value)

    command.Parameters.Append(param)

    End Sub

    adCurrency is = 6.  I am using the SQLOleDB driver and SQL Server 2K.  Does anyone know why this code is returning this error.

    Thanks.

  • i think it's just the missing SET command for an Object; otherwise your syntax is exactly what i use.

    SET param = command.CreateParameter(paramName, adCurrency, adParamInput, 8, value)

    otherwise it might be the size paramter of 8 that you are assigning; leave that blank:

    Set paramObj = CmdObj.CreateParameter("@HOPWATBLKEY", adInteger, adParamInput, , HOPWAobj.acttblkey)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Duh!  Of course!  Thanks.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply