0

I am converting Visual Basic 6.0 code to .NET 4.5. I have the following lines of code. Can you tell me what they mean?

SQLMappingTables = " SELECT * FROM MappingTables " & _
                    " WHERE  Group_Level = ? " & _
                    "    AND Group_Code  = ? " & _
                    "    AND Code = ? " 
Set Cmd_MappingTables = New ADODB.Command
Cmd_MappingTables.CommandText = SQLMappingTables
Cmd_MappingTables.CommandType = adCmdText
/// These are the line I do not understand
Set DefGroup_Level = Cmd_MappingTables.CreateParameter(, adChar, adParamInput, 1)
Set DefGroup_Code = Cmd_MappingTables.CreateParameter(, adChar, adParamInput, 15)
Set DefCode8 = Cmd_MappingTables.CreateParameter(, adChar, adParamInput, 3)

1 Answer 1

1

It defines three unnamed (first parameter left out) string (adChar) input parameters (adParamInput) of length 1, 15 and 3.

You can find a description here.

I would expect the subsequent lines to assign values to the input parameters, before the command is executed.

2
  • Lindback Thanks for your quick response so if i pass value in SQLMappingTables what will the result as example is there Group_Level = adchar, Group_Code= adParamInput, Code = 15
    – Abhishek
    Commented Jun 25, 2013 at 13:40
  • 1
    Look for code that assigns values to DefGroup_Level, DefGroup_Code and DefCode8. Those are the search parameters that correspond to the three ? in the SELECT statement. The assignment of the search values is not included in the code you posted in the question. Commented Jun 25, 2013 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.