This time it turned VB6 .... (┬_┬)
---------------------------------------------------------------------------------------
CreateParameter method
Creates a new Parameter object with the specified properties.
Grammar
Set parameter = command. CreateParameter (Name, Type, Direction, Size, Value)
return value
Returns the Parameter object.
Parameters
Name Optional, string that represents the Parameter object name.
Type optional, long integer value that specifies the Parameter object data type. For valid settings, see Type property.
Direction optional, long integer value specifying the Parameter object type. For valid settings, see the Direction property.
The Size is an optional, Long value that specifies the maximum length of the parameter value, in characters or bytes.
Value optional, Variant type, specifying the value of the Parameter object. 15013772506
Description
Use the CreateParameter method to create a new Parameter object with the specified name, type, direction, size, and value. All values that are passed in the parameter are written to the corresponding Parameter property.
The method cannot automatically append the Parameter object to the Parameter collection of the Command object, so that additional properties can be set. If the Parameter object is appended to the collection, ADO causes the value of the attached property to take effect.
If you specify a variable-length data type in the type parameter, you must either transfer the size parameter or set the Size property of the Parameter object before appending it to the Parameters collection, or an error will result.
Type Property
Indicates the action type or data type of the Parameter, Field, or Property object.
Set and return values
Sets or returns one of the following DataTypeEnum values. The corresponding OLE DB type identifiers are given in parentheses in the Description column of the following table. For more information about OLE DB data types, see the Appendix to chapter 10th and the OLE DB Programmer's Reference
Constant description
Adarray joins the logical OR with other types to indicate that the data is that type of safe array (Dbtype_array).
adBigInt a 8-byte signed integer (DBTYPE_I8).
Adbinary binary Value (dbtype_bytes).
Adboolean boolean value (Dbtype_bool).
Adbyref joins other types with a logical OR to indicate that the data is a pointer to another type of data (DBTYPE_BYREF).
ADBSTR a null-terminated string (Unicode) (DBTYPE_BSTR).
Adchar String Value (DBTYPE_STR).
Adcurrency currency Value (dbtype_cy). The decimal position of the currency number is fixed and there are four digits to the right of the decimal point. This value is saved as a signed integer value with a 8-byte range of 10,000.
Addate Date value (DBTYPE_DATE). The date is saved as a double value, and the number represents the number of days starting from December 1899 30. The fractional part is the fragment time of the day.
adDBDate Date Value (YYYYMMDD) (dbtype_dbdate).
adDBTime time Value (HHMMSS) (dbtype_dbtime).
adDBTimeStamp Timestamp (YYYYMMDDHHMMSS plus 1 billion fractions) (Dbtype_dbtimestamp).
The addecimal has an exact numeric value (DBTYPE_DECIMAL) with fixed precision and range.
addouble Double-precision floating-point value (DBTYPE_R8).
Adempty No value specified (Dbtype_empty).
Aderror 32-bit error code (DBTYPE_ERROR).
The adguid globally unique identifier (GUID) (DBTYPE_GUID).
adIDispatch A pointer to the Idispatch interface on an OLE object (Dbtype_idispatch).
Adinteger 4-byte signed integer (DBTYPE_I4).
adIUnknown A pointer to the IUnknown interface on an OLE object (Dbtype_iunknown).
Adlongvarbinary Long Binary value (only for Parameter objects).
adLongVarChar Long String value (for Parameter object only).
adLongVarWChar a long string value with a null end (only for Parameter objects).
The adnumeric has an exact numeric value (dbtype_numeric) with fixed precision and range.
Adsingle single-precision floating-point value (DBTYPE_R4).
adSmallInt 2-byte signed integer (DBTYPE_I2).
Adtinyint 1-byte signed integer (DBTYPE_I1).
Adunsignedbigint 8-byte unsigned integer (DBTYPE_UI8).
Adunsignedint 4-byte unsigned integer (DBTYPE_UI4).
Adunsignedsmallint 2-byte unsigned integer (DBTYPE_UI2).
Adunsignedtinyint 1-byte unsigned integer (DBTYPE_UI1).
aduserdefined user-defined variables (DBTYPE_UDT).
Advarbinary binary Value (Parameter object only).
adVarChar String Value (Parameter object only).
Advariant Automatic variant type (dbtype_variant).
Advector joins with other types in a logical OR, indicating that the data is a dbvector structure (defined by OLE DB). The structure contains the count of elements and pointers to other types of data (Dbtype_vector).
adVarWChar a null-terminated Unicode string (Parameter object only).
Adwchar a null-terminated Unicode string (DBTYPE_WSTR).
Description
For the Parameter object, the Type property is read/write. For all other objects, the Type property is read-only.
Direction Property
Indicates whether the input parameter, the output parameter, or both the output and the input parameters are indicated by the Parameter, or if the parameter is the value returned by the stored procedure.
Set and return values
Sets or returns one of the following ParameterDirectionEnum values.
Constant description
Adparamunknown indicates that the parameter direction is unknown.
adParamInput the default value. Indicates the input parameters.
adParamOutput indicates the output parameter.
The adparaminputoutput also indicates the input and output parameters.
adParamReturnValue indicates the return value.
Description
Use the Direction property to specify how parameters are passed to the procedure or passed from the procedure. The Direction property is read/write, which allows you to use a provider that does not return the information, or to set it when you do not want ADO to append the call provider in order to obtain the parameter information.
Not all providers can determine the direction of a parameter in their stored procedure. In this case, you must set the Direction property before executing the query.
----------------------------------------------------------------
According to the above instructions, each parameter should have some fixed parameter notation, but I see the following part of the code, I do not know why the parameters are a bunch of numbers ...
Do not understand the individual numbers have what escape?? The face of the ignorant.
Gudterrobject.position ="fncprocrun_0010" 'Hishinuma started Me. MousePointer = One SetobjCMD =CreateObject("Adodb.command") SetOBJPRM =CreateObject("ADODB. Parameter") Strprocsql="ad_sir_if. Ad_main_r" withobjcmd gudterrobject.position="fncprocrun_0020" 'コマンド Setting. CommandText =Strprocsql. CommandType=4 . ActiveConnection=objoradb gudterrobject.position="fncprocrun_0030" 'In number of settings SetOBJPRM =. CreateParameter ("pc_kai_code_i",129,1,5) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("pc_kmk_kaikake_i", $,1,255) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("pc_kmk_setsubi_i", $,1,255) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("pc_rpl_date_s_i",129,1,Ten) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("pc_rpl_date_e_i",129,1,Ten) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("pc_sir_code_s_i",129,1, -) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("pc_sir_code_e_i",129,1, -) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("Pc_rec_kbn_i",129,1,1) . Parameters.Append OBJPRM gudterrobject.position="fncprocrun_0040" 'set of Out arguments (エラー) SetOBJPRM =. CreateParameter ("Pn_ret_sts_o", +,2,Ten) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("Pv_err_pos_o", $,2,255) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("Pn_err_code_o", +,2,Ten) . Parameters.Append OBJPRMSetOBJPRM =. CreateParameter ("Pv_err_msg_o", $,2,255) . Parameters.Append OBJPRM gudterrobject.position="fncprocrun_0050" 'In arguments occupies setting. Parameters ("pc_kai_code_i"). Value =Gstrtenrenkeikaicode. Parameters ("pc_kmk_kaikake_i"). Value =Gstrkamokukaikake. Parameters ("pc_kmk_setsubi_i"). Value =Gstrkamokusetsubi. Parameters ("pc_rpl_date_s_i"). Value =IIf(IsNull (Imdate (0). Value),"", Imdate (0). Value). Parameters ("pc_rpl_date_e_i"). Value =IIf(IsNull (Imdate (1). Value),"", Imdate (1). Value). Parameters ("pc_sir_code_s_i"). Value = Imtxtshiiresakicode (0). Text. Parameters ("pc_sir_code_e_i"). Value = Imtxtshiiresakicode (1). Text. Parameters ("Pc_rec_kbn_i"). Value =Gstrmode. ExecuteIf. Parameters ("Pn_ret_sts_o"). Value =0 Then 'The normal end of the square Me. MousePointer =0 Else 'It's always the same GoToProcerrwrite'エラー expands Hishinuma 面責 End If on Error GoTo 0 SetOBJPRM = Nothing SetobjCMD = Nothing End with
VB call stored Procedure-CreateParameter method