Click here to Skip to main content
16,016,962 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

below is my code


VB
Public Function mp(ByVal PName As String, ByVal PType As ADODB.DataTypeEnum, ByVal PSize As Long, ByVal PValue As Object) As Object

        
        'mp = Array(PName, PType, PSize, PValue)
    End Function

----------> this function is used in this

VB
intRunCount = m_dbh.RunSPReturnInteger("Extract_RunCount", Array(mp("@RunCycle", DataTypeEnum.adChar, 10, mCycle)))

--------------> And in the function RunSPReturnInteger internally collectparams method is called for which this array is passed as input and i have mentioned collect params method below.

VB
Public Function RunSPReturnInteger(ByVal strSP As String, Optional params As Variant) As Variant
    On Error GoTo errorHandler
    
    ' //Create the ADO objects
    Dim cmd As ADODB.Command
    Set cmd = New ADODB.Command
    
    '// Init the ADO objects & the stored proc parameters
    cmd.ActiveConnection = GetConnectionString()
    cmd.CommandText = strSP
    cmd.CommandType = adCmdStoredProc

    collectParams (cmd, params)
    
    '//Assume the last parameter is outgoing and named @retval (specific for FMStocks)
    cmd.Parameters.Append cmd.CreateParameter("@retval", adInteger, _
        adParamOutput, 4)
    
    ' //Execute without a resulting recordset and pull out the "return value" parameter
    cmd.Execute , , ADODB.adExecuteNoRecords
    RunSPReturnInteger = cmd.Parameters("@retval").Value
    
    ' //Cleanup and return
    Set cmd.ActiveConnection = Nothing
    Set cmd = Nothing
    Exit Function



in vb6 mp array is working fine but in vb8 it's showing error how can i pass ddifferent datatypes to array in vb8
Posted
Updated 9-Oct-14 2:24am
v3
Comments
[no name] 9-Oct-14 8:18am    
VB6 != VB.NET of any version. Forget the VB6 code and learn the .NET framework. Besides that, we would have no idea what "showing error" means.
Richard Deeming 9-Oct-14 8:46am    
Don't try to use ADODB in .NET - use ADO.NET instead:
Migrating Code and Concepts from ADO "Classic" to ADO.NET[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900