Type mismatch - using arrays and functions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laura

    Type mismatch - using arrays and functions

    Help. Below is my code. Getting Type mismatch error on
    the noted line. I'm trying to send an array (aryNewD)
    with 4 columns and x rows to a function to save all the
    array info into a SQL Server table via a stored
    procedure. Keep getting this error. Any suggestions?

    Code:
    'ASP:

    if blnNewD then
    dim blnWrite
    if fDisasterDescri ption_Write2(ar yNewD) = 1
    then 'ERROR MESSAGE POINTS TO THIS LINE
    blnWrite = True
    else
    blnWrite = False
    end if
    if not blnWrite then blnValid = False
    if blnValid = False then
    response.write "An error has occured."
    response.end
    end if
    end if

    '---------------------------------------------------------
    -----------------------------
    'Function:

    function fDisasterDescri ption_Write2(ar yNewD)


    dim conDisasterWast e, cmdDisasterWast e,
    blnCriticalErro r
    dim param1, param2, param3, param4, param5
    dim my_adCmdStoredP roc, my_adChar, my_adInteger,
    my_adParamInput
    dim my_adSmallInt, my_adVarChar, my_adDate
    dim strTypeID, strDescription, strDate, intDisasterID

    my_adCmdStoredP roc = &H0004
    my_adChar = 129
    my_adInteger = 3
    my_adParamInput = &H0001
    my_adSmallInt = 2
    my_advarchar = 200
    my_adDate = 7

    'Set the Connection Object

    set conDisasterWast e = server.createob ject
    ("ADODB.Connect ion")

    conDisasterWast e.Open "database", "username", "password"

    'Run stored procedure

    set cmdDisasterWast e = server.CreateOb ject
    ("ADODB.Command ")

    set cmdDisasterWast e.ActiveConnect ion =
    conDisasterWast e
    cmdDisasterWast e.CommandType = my_adCmdStoredP roc
    cmdDisasterWast e.CommandText
    = "tf_insert_Disa sterDescription "

    set param1 = cmdDisasterWast e.CreateParamet er
    ("@idLandfil l", my_adChar, my_adParamInput , 12)
    set param2 = cmdDisasterWast e.CreateParamet er
    ("@typeID", my_adSmallint, my_adParamInput )
    set param3 = cmdDisasterWast e.CreateParamet er
    ("@description" , my_advarchar, my_adParamInput , 1000)
    set param4 = cmdDisasterWast e.CreateParamet er("@date",
    my_adDate, my_adParamInput )
    set param5 = cmdDisasterWast e.CreateParamet er
    ("@disasteri d", my_adinteger, my_adParamInput )

    cmdDisasterWast e.Parameters.Ap pend(param1)
    cmdDisasterWast e.Parameters.Ap pend(param2)
    cmdDisasterWast e.Parameters.Ap pend(param3)
    cmdDisasterWast e.Parameters.Ap pend(param4)
    cmdDisasterWast e.Parameters.Ap pend(param5)

    cmdDisasterWast e.Parameters("@ idlandfill") = Session
    ("idlandfill ")

    For i = 0 to ubound(aryNewD, 2)
    strTypeID = aryNewD(1, i)
    strDescription = aryNewD(3, i)
    strDate = aryNewD(2, i)
    intDisasterID = aryNewD(0, i)

    cmdDisasterWast e.Parameters("@ typeID") = strTypeID
    cmdDisasterWast e.Parameters("@ description") =
    strDescription
    cmdDisasterWast e.Parameters("@ date") = strDate
    cmdDisasterWast e.Parameters("@ disasterid") =
    intDisasterID

    cmdDisasterWast e.execute
    Next

    If Err.number = 0 then
    fDisasterDescri ption_Write2 = 1
    Else
    fDisasterDescri ption_Write2 = 2
    Response.Write( err.description & "<br>")
    end if

    set cmdDisasterWast e.ActiveConnect ion = Nothing
    set cmdDisasterWast e = Nothing

    conDisasterWast e.Close
    set conDisasterWast e = Nothing


    end function

    THANK YOU!

  • AspDotNetDeveloper

    #2
    Re: Type mismatch - using arrays and functions

    You should use the IsArray function to test that it is actually an array,
    before calling the function, or in the first part of the function.

    "Laura" <Please.reply@t o.the.newsgroup > wrote in message
    news:851001c351 5b$f25f9510$7d0 2280a@phx.gbl.. .[color=blue]
    > Help. Below is my code. Getting Type mismatch error on
    > the noted line. I'm trying to send an array (aryNewD)
    > with 4 columns and x rows to a function to save all the
    > array info into a SQL Server table via a stored
    > procedure. Keep getting this error. Any suggestions?
    >
    > Code:
    > 'ASP:
    >
    > if blnNewD then
    > dim blnWrite
    > if fDisasterDescri ption_Write2(ar yNewD) = 1
    > then 'ERROR MESSAGE POINTS TO THIS LINE
    > blnWrite = True
    > else
    > blnWrite = False
    > end if
    > if not blnWrite then blnValid = False
    > if blnValid = False then
    > response.write "An error has occured."
    > response.end
    > end if
    > end if
    >
    > '---------------------------------------------------------
    > -----------------------------
    > 'Function:
    >
    > function fDisasterDescri ption_Write2(ar yNewD)
    >
    >
    > dim conDisasterWast e, cmdDisasterWast e,
    > blnCriticalErro r
    > dim param1, param2, param3, param4, param5
    > dim my_adCmdStoredP roc, my_adChar, my_adInteger,
    > my_adParamInput
    > dim my_adSmallInt, my_adVarChar, my_adDate
    > dim strTypeID, strDescription, strDate, intDisasterID
    >
    > my_adCmdStoredP roc = &H0004
    > my_adChar = 129
    > my_adInteger = 3
    > my_adParamInput = &H0001
    > my_adSmallInt = 2
    > my_advarchar = 200
    > my_adDate = 7
    >
    > 'Set the Connection Object
    >
    > set conDisasterWast e = server.createob ject
    > ("ADODB.Connect ion")
    >
    > conDisasterWast e.Open "database", "username", "password"
    >
    > 'Run stored procedure
    >
    > set cmdDisasterWast e = server.CreateOb ject
    > ("ADODB.Command ")
    >
    > set cmdDisasterWast e.ActiveConnect ion =
    > conDisasterWast e
    > cmdDisasterWast e.CommandType = my_adCmdStoredP roc
    > cmdDisasterWast e.CommandText
    > = "tf_insert_Disa sterDescription "
    >
    > set param1 = cmdDisasterWast e.CreateParamet er
    > ("@idLandfil l", my_adChar, my_adParamInput , 12)
    > set param2 = cmdDisasterWast e.CreateParamet er
    > ("@typeID", my_adSmallint, my_adParamInput )
    > set param3 = cmdDisasterWast e.CreateParamet er
    > ("@description" , my_advarchar, my_adParamInput , 1000)
    > set param4 = cmdDisasterWast e.CreateParamet er("@date",
    > my_adDate, my_adParamInput )
    > set param5 = cmdDisasterWast e.CreateParamet er
    > ("@disasteri d", my_adinteger, my_adParamInput )
    >
    > cmdDisasterWast e.Parameters.Ap pend(param1)
    > cmdDisasterWast e.Parameters.Ap pend(param2)
    > cmdDisasterWast e.Parameters.Ap pend(param3)
    > cmdDisasterWast e.Parameters.Ap pend(param4)
    > cmdDisasterWast e.Parameters.Ap pend(param5)
    >
    > cmdDisasterWast e.Parameters("@ idlandfill") = Session
    > ("idlandfill ")
    >
    > For i = 0 to ubound(aryNewD, 2)
    > strTypeID = aryNewD(1, i)
    > strDescription = aryNewD(3, i)
    > strDate = aryNewD(2, i)
    > intDisasterID = aryNewD(0, i)
    >
    > cmdDisasterWast e.Parameters("@ typeID") = strTypeID
    > cmdDisasterWast e.Parameters("@ description") =
    > strDescription
    > cmdDisasterWast e.Parameters("@ date") = strDate
    > cmdDisasterWast e.Parameters("@ disasterid") =
    > intDisasterID
    >
    > cmdDisasterWast e.execute
    > Next
    >
    > If Err.number = 0 then
    > fDisasterDescri ption_Write2 = 1
    > Else
    > fDisasterDescri ption_Write2 = 2
    > Response.Write( err.description & "<br>")
    > end if
    >
    > set cmdDisasterWast e.ActiveConnect ion = Nothing
    > set cmdDisasterWast e = Nothing
    >
    > conDisasterWast e.Close
    > set conDisasterWast e = Nothing
    >
    >
    > end function
    >
    > THANK YOU!
    >[/color]


    Comment

    • Laura

      #3
      Re: Type mismatch - using arrays and functions

      Even if I change the function to get rid of the database
      crap and simply be the following:

      function fDisasterDescri ption_write3(ar yNewD)

      dim strTypeID, strDescription, strDate, intDisasterID

      fDisasterDescri ption_write3 = 2

      For i = 0 to ubound(aryNewD, 2)
      strTypeID = aryNewD(1, i)
      strDescription = aryNewD(3, i)
      strDate = aryNewD(2, i)
      intDisasterID = aryNewD(0, i)

      response.write strTypeID & ", " & strDescription
      & ", " & strDate & ", " & intDisasterID & "<br>"
      Next

      if err.number > 0 then
      fDisasterDescri ption_Write3 = 2
      else
      fDisasterDescri ption_Write3 = 1
      end if

      end function


      I still have the same type mismatch error. Help?[color=blue]
      >-----Original Message-----
      >Checked - it is an array, but still no go with the
      >function. Other ideas?[color=green]
      >>-----Original Message-----
      >>You should use the IsArray function to test that it is[/color]
      >actually an array,[color=green]
      >>before calling the function, or in the first part of[/color][/color]
      the[color=blue]
      >function.[color=green]
      >>
      >>"Laura" <Please.reply@t o.the.newsgroup > wrote in message
      >>news:851001c3 515b$f25f9510$7 d02280a@phx.gbl ...[color=darkred]
      >>> Help. Below is my code. Getting Type mismatch error[/color][/color]
      >on[color=green][color=darkred]
      >>> the noted line. I'm trying to send an array (aryNewD)
      >>> with 4 columns and x rows to a function to save all[/color][/color][/color]
      the[color=blue][color=green][color=darkred]
      >>> array info into a SQL Server table via a stored
      >>> procedure. Keep getting this error. Any suggestions?
      >>>
      >>> Code:
      >>> 'ASP:
      >>>
      >>> if blnNewD then
      >>> dim blnWrite
      >>> if fDisasterDescri ption_Write2(ar yNewD) = 1
      >>> then 'ERROR MESSAGE POINTS TO THIS LINE
      >>> blnWrite = True
      >>> else
      >>> blnWrite = False
      >>> end if
      >>> if not blnWrite then blnValid = False
      >>> if blnValid = False then
      >>> response.write "An error has occured."
      >>> response.end
      >>> end if
      >>> end if
      >>>
      >>> '-----------------------------------------------------[/color][/color][/color]
      -[color=blue]
      >---[color=green][color=darkred]
      >>> -----------------------------
      >>> 'Function:
      >>>
      >>> function fDisasterDescri ption_Write2(ar yNewD)
      >>>
      >>>
      >>> dim conDisasterWast e, cmdDisasterWast e,
      >>> blnCriticalErro r
      >>> dim param1, param2, param3, param4, param5
      >>> dim my_adCmdStoredP roc, my_adChar, my_adInteger,
      >>> my_adParamInput
      >>> dim my_adSmallInt, my_adVarChar, my_adDate
      >>> dim strTypeID, strDescription, strDate,[/color][/color]
      >intDisasterI D[color=green][color=darkred]
      >>>
      >>> my_adCmdStoredP roc = &H0004
      >>> my_adChar = 129
      >>> my_adInteger = 3
      >>> my_adParamInput = &H0001
      >>> my_adSmallInt = 2
      >>> my_advarchar = 200
      >>> my_adDate = 7
      >>>
      >>> 'Set the Connection Object
      >>>
      >>> set conDisasterWast e = server.createob ject
      >>> ("ADODB.Connect ion")
      >>>
      >>>[/color][/color]
      >conDisasterWas te.Open "database", "username", "password"[color=green][color=darkred]
      >>>
      >>> 'Run stored procedure
      >>>
      >>> set cmdDisasterWast e = server.CreateOb ject
      >>> ("ADODB.Command ")
      >>>
      >>> set cmdDisasterWast e.ActiveConnect ion =
      >>> conDisasterWast e
      >>> cmdDisasterWast e.CommandType = my_adCmdStoredP roc
      >>> cmdDisasterWast e.CommandText
      >>> = "tf_insert_Disa sterDescription "
      >>>
      >>> set param1 = cmdDisasterWast e.CreateParamet er
      >>> ("@idLandfil l", my_adChar, my_adParamInput , 12)
      >>> set param2 = cmdDisasterWast e.CreateParamet er
      >>> ("@typeID", my_adSmallint, my_adParamInput )
      >>> set param3 = cmdDisasterWast e.CreateParamet er
      >>> ("@description" , my_advarchar, my_adParamInput , 1000)
      >>> set param4 = cmdDisasterWast e.CreateParamet er[/color][/color]
      >("@date",[color=green][color=darkred]
      >>> my_adDate, my_adParamInput )
      >>> set param5 = cmdDisasterWast e.CreateParamet er
      >>> ("@disasteri d", my_adinteger, my_adParamInput )
      >>>
      >>> cmdDisasterWast e.Parameters.Ap pend(param1)
      >>> cmdDisasterWast e.Parameters.Ap pend(param2)
      >>> cmdDisasterWast e.Parameters.Ap pend(param3)
      >>> cmdDisasterWast e.Parameters.Ap pend(param4)
      >>> cmdDisasterWast e.Parameters.Ap pend(param5)
      >>>
      >>> cmdDisasterWast e.Parameters("@ idlandfill") =[/color][/color][/color]
      Session[color=blue][color=green][color=darkred]
      >>> ("idlandfill ")
      >>>
      >>> For i = 0 to ubound(aryNewD, 2)
      >>> strTypeID = aryNewD(1, i)
      >>> strDescription = aryNewD(3, i)
      >>> strDate = aryNewD(2, i)
      >>> intDisasterID = aryNewD(0, i)
      >>>
      >>> cmdDisasterWast e.Parameters("@ typeID") =[/color][/color]
      >strTypeID[color=green][color=darkred]
      >>> cmdDisasterWast e.Parameters("@ description") =
      >>> strDescription
      >>> cmdDisasterWast e.Parameters("@ date") = strDate
      >>> cmdDisasterWast e.Parameters("@ disasterid") =
      >>> intDisasterID
      >>>
      >>> cmdDisasterWast e.execute
      >>> Next
      >>>
      >>> If Err.number = 0 then
      >>> fDisasterDescri ption_Write2 = 1
      >>> Else
      >>> fDisasterDescri ption_Write2 = 2
      >>> Response.Write( err.description & "<br>")
      >>> end if
      >>>
      >>> set cmdDisasterWast e.ActiveConnect ion = Nothing
      >>> set cmdDisasterWast e = Nothing
      >>>
      >>> conDisasterWast e.Close
      >>> set conDisasterWast e = Nothing
      >>>
      >>>
      >>> end function
      >>>
      >>> THANK YOU!
      >>>[/color]
      >>
      >>
      >>.
      >>[/color]
      >.
      >[/color]

      Comment

      • Mark Schupp

        #4
        Re: Type mismatch - using arrays and functions

        What happens if you set the function result to a variable

        dim code

        code = fDisasterDescri ption_Write2(ar yNewD)
        Response.Write code

        --
        Mark Schupp
        --
        Head of Development
        Integrity eLearning
        Online Learning Solutions Provider
        mschupp@ielearn ing.com
        Advancing limitless knowledge and continual growth to create confident problem solvers, one course at a time.

        714.637.9480 x17


        "Laura" <please.reply@t o.the.newsgroup > wrote in message
        news:067c01c351 63$60b2f960$a10 1280a@phx.gbl.. .[color=blue]
        > Even if I change the function to get rid of the database
        > crap and simply be the following:
        >
        > function fDisasterDescri ption_write3(ar yNewD)
        >
        > dim strTypeID, strDescription, strDate, intDisasterID
        >
        > fDisasterDescri ption_write3 = 2
        >
        > For i = 0 to ubound(aryNewD, 2)
        > strTypeID = aryNewD(1, i)
        > strDescription = aryNewD(3, i)
        > strDate = aryNewD(2, i)
        > intDisasterID = aryNewD(0, i)
        >
        > response.write strTypeID & ", " & strDescription
        > & ", " & strDate & ", " & intDisasterID & "<br>"
        > Next
        >
        > if err.number > 0 then
        > fDisasterDescri ption_Write3 = 2
        > else
        > fDisasterDescri ption_Write3 = 1
        > end if
        >
        > end function
        >
        >
        > I still have the same type mismatch error. Help?[color=green]
        > >-----Original Message-----
        > >Checked - it is an array, but still no go with the
        > >function. Other ideas?[color=darkred]
        > >>-----Original Message-----
        > >>You should use the IsArray function to test that it is[/color]
        > >actually an array,[color=darkred]
        > >>before calling the function, or in the first part of[/color][/color]
        > the[color=green]
        > >function.[color=darkred]
        > >>
        > >>"Laura" <Please.reply@t o.the.newsgroup > wrote in message
        > >>news:851001c3 515b$f25f9510$7 d02280a@phx.gbl ...
        > >>> Help. Below is my code. Getting Type mismatch error[/color]
        > >on[color=darkred]
        > >>> the noted line. I'm trying to send an array (aryNewD)
        > >>> with 4 columns and x rows to a function to save all[/color][/color]
        > the[color=green][color=darkred]
        > >>> array info into a SQL Server table via a stored
        > >>> procedure. Keep getting this error. Any suggestions?
        > >>>
        > >>> Code:
        > >>> 'ASP:
        > >>>
        > >>> if blnNewD then
        > >>> dim blnWrite
        > >>> if fDisasterDescri ption_Write2(ar yNewD) = 1
        > >>> then 'ERROR MESSAGE POINTS TO THIS LINE
        > >>> blnWrite = True
        > >>> else
        > >>> blnWrite = False
        > >>> end if
        > >>> if not blnWrite then blnValid = False
        > >>> if blnValid = False then
        > >>> response.write "An error has occured."
        > >>> response.end
        > >>> end if
        > >>> end if
        > >>>
        > >>> '-----------------------------------------------------[/color][/color]
        > -[color=green]
        > >---[color=darkred]
        > >>> -----------------------------
        > >>> 'Function:
        > >>>
        > >>> function fDisasterDescri ption_Write2(ar yNewD)
        > >>>
        > >>>
        > >>> dim conDisasterWast e, cmdDisasterWast e,
        > >>> blnCriticalErro r
        > >>> dim param1, param2, param3, param4, param5
        > >>> dim my_adCmdStoredP roc, my_adChar, my_adInteger,
        > >>> my_adParamInput
        > >>> dim my_adSmallInt, my_adVarChar, my_adDate
        > >>> dim strTypeID, strDescription, strDate,[/color]
        > >intDisasterI D[color=darkred]
        > >>>
        > >>> my_adCmdStoredP roc = &H0004
        > >>> my_adChar = 129
        > >>> my_adInteger = 3
        > >>> my_adParamInput = &H0001
        > >>> my_adSmallInt = 2
        > >>> my_advarchar = 200
        > >>> my_adDate = 7
        > >>>
        > >>> 'Set the Connection Object
        > >>>
        > >>> set conDisasterWast e = server.createob ject
        > >>> ("ADODB.Connect ion")
        > >>>
        > >>>[/color]
        > >conDisasterWas te.Open "database", "username", "password"[color=darkred]
        > >>>
        > >>> 'Run stored procedure
        > >>>
        > >>> set cmdDisasterWast e = server.CreateOb ject
        > >>> ("ADODB.Command ")
        > >>>
        > >>> set cmdDisasterWast e.ActiveConnect ion =
        > >>> conDisasterWast e
        > >>> cmdDisasterWast e.CommandType = my_adCmdStoredP roc
        > >>> cmdDisasterWast e.CommandText
        > >>> = "tf_insert_Disa sterDescription "
        > >>>
        > >>> set param1 = cmdDisasterWast e.CreateParamet er
        > >>> ("@idLandfil l", my_adChar, my_adParamInput , 12)
        > >>> set param2 = cmdDisasterWast e.CreateParamet er
        > >>> ("@typeID", my_adSmallint, my_adParamInput )
        > >>> set param3 = cmdDisasterWast e.CreateParamet er
        > >>> ("@description" , my_advarchar, my_adParamInput , 1000)
        > >>> set param4 = cmdDisasterWast e.CreateParamet er[/color]
        > >("@date",[color=darkred]
        > >>> my_adDate, my_adParamInput )
        > >>> set param5 = cmdDisasterWast e.CreateParamet er
        > >>> ("@disasteri d", my_adinteger, my_adParamInput )
        > >>>
        > >>> cmdDisasterWast e.Parameters.Ap pend(param1)
        > >>> cmdDisasterWast e.Parameters.Ap pend(param2)
        > >>> cmdDisasterWast e.Parameters.Ap pend(param3)
        > >>> cmdDisasterWast e.Parameters.Ap pend(param4)
        > >>> cmdDisasterWast e.Parameters.Ap pend(param5)
        > >>>
        > >>> cmdDisasterWast e.Parameters("@ idlandfill") =[/color][/color]
        > Session[color=green][color=darkred]
        > >>> ("idlandfill ")
        > >>>
        > >>> For i = 0 to ubound(aryNewD, 2)
        > >>> strTypeID = aryNewD(1, i)
        > >>> strDescription = aryNewD(3, i)
        > >>> strDate = aryNewD(2, i)
        > >>> intDisasterID = aryNewD(0, i)
        > >>>
        > >>> cmdDisasterWast e.Parameters("@ typeID") =[/color]
        > >strTypeID[color=darkred]
        > >>> cmdDisasterWast e.Parameters("@ description") =
        > >>> strDescription
        > >>> cmdDisasterWast e.Parameters("@ date") = strDate
        > >>> cmdDisasterWast e.Parameters("@ disasterid") =
        > >>> intDisasterID
        > >>>
        > >>> cmdDisasterWast e.execute
        > >>> Next
        > >>>
        > >>> If Err.number = 0 then
        > >>> fDisasterDescri ption_Write2 = 1
        > >>> Else
        > >>> fDisasterDescri ption_Write2 = 2
        > >>> Response.Write( err.description & "<br>")
        > >>> end if
        > >>>
        > >>> set cmdDisasterWast e.ActiveConnect ion = Nothing
        > >>> set cmdDisasterWast e = Nothing
        > >>>
        > >>> conDisasterWast e.Close
        > >>> set conDisasterWast e = Nothing
        > >>>
        > >>>
        > >>> end function
        > >>>
        > >>> THANK YOU!
        > >>>
        > >>
        > >>
        > >>.
        > >>[/color]
        > >.
        > >[/color][/color]


        Comment

        • Joe Iano

          #5
          Re: Type mismatch - using arrays and functions

          Have you tried forcing the type?
          like: cint(var1) = cint(var1)

          "Laura" <Please.reply@t o.the.newsgroup > wrote in message
          news:851001c351 5b$f25f9510$7d0 2280a@phx.gbl.. .
          Help. Below is my code. Getting Type mismatch error on
          the noted line. I'm trying to send an array (aryNewD)
          with 4 columns and x rows to a function to save all the
          array info into a SQL Server table via a stored
          procedure. Keep getting this error. Any suggestions?

          Code:
          'ASP:

          if blnNewD then
          dim blnWrite
          if fDisasterDescri ption_Write2(ar yNewD) = 1
          then 'ERROR MESSAGE POINTS TO THIS LINE
          blnWrite = True
          else
          blnWrite = False
          end if
          if not blnWrite then blnValid = False
          if blnValid = False then
          response.write "An error has occured."
          response.end
          end if
          end if

          '---------------------------------------------------------
          -----------------------------
          'Function:

          function fDisasterDescri ption_Write2(ar yNewD)


          dim conDisasterWast e, cmdDisasterWast e,
          blnCriticalErro r
          dim param1, param2, param3, param4, param5
          dim my_adCmdStoredP roc, my_adChar, my_adInteger,
          my_adParamInput
          dim my_adSmallInt, my_adVarChar, my_adDate
          dim strTypeID, strDescription, strDate, intDisasterID

          my_adCmdStoredP roc = &H0004
          my_adChar = 129
          my_adInteger = 3
          my_adParamInput = &H0001
          my_adSmallInt = 2
          my_advarchar = 200
          my_adDate = 7

          'Set the Connection Object

          set conDisasterWast e = server.createob ject
          ("ADODB.Connect ion")

          conDisasterWast e.Open "database", "username", "password"

          'Run stored procedure

          set cmdDisasterWast e = server.CreateOb ject
          ("ADODB.Command ")

          set cmdDisasterWast e.ActiveConnect ion =
          conDisasterWast e
          cmdDisasterWast e.CommandType = my_adCmdStoredP roc
          cmdDisasterWast e.CommandText
          = "tf_insert_Disa sterDescription "

          set param1 = cmdDisasterWast e.CreateParamet er
          ("@idLandfil l", my_adChar, my_adParamInput , 12)
          set param2 = cmdDisasterWast e.CreateParamet er
          ("@typeID", my_adSmallint, my_adParamInput )
          set param3 = cmdDisasterWast e.CreateParamet er
          ("@description" , my_advarchar, my_adParamInput , 1000)
          set param4 = cmdDisasterWast e.CreateParamet er("@date",
          my_adDate, my_adParamInput )
          set param5 = cmdDisasterWast e.CreateParamet er
          ("@disasteri d", my_adinteger, my_adParamInput )

          cmdDisasterWast e.Parameters.Ap pend(param1)
          cmdDisasterWast e.Parameters.Ap pend(param2)
          cmdDisasterWast e.Parameters.Ap pend(param3)
          cmdDisasterWast e.Parameters.Ap pend(param4)
          cmdDisasterWast e.Parameters.Ap pend(param5)

          cmdDisasterWast e.Parameters("@ idlandfill") = Session
          ("idlandfill ")

          For i = 0 to ubound(aryNewD, 2)
          strTypeID = aryNewD(1, i)
          strDescription = aryNewD(3, i)
          strDate = aryNewD(2, i)
          intDisasterID = aryNewD(0, i)

          cmdDisasterWast e.Parameters("@ typeID") = strTypeID
          cmdDisasterWast e.Parameters("@ description") =
          strDescription
          cmdDisasterWast e.Parameters("@ date") = strDate
          cmdDisasterWast e.Parameters("@ disasterid") =
          intDisasterID

          cmdDisasterWast e.execute
          Next

          If Err.number = 0 then
          fDisasterDescri ption_Write2 = 1
          Else
          fDisasterDescri ption_Write2 = 2
          Response.Write( err.description & "<br>")
          end if

          set cmdDisasterWast e.ActiveConnect ion = Nothing
          set cmdDisasterWast e = Nothing

          conDisasterWast e.Close
          set conDisasterWast e = Nothing


          end function

          THANK YOU!


          Comment

          Working...