Home > Software engineering >  Vb in the current operation using the wrong type of value for help
Vb in the current operation using the wrong type of value for help

Time:09-21

Using VB to develop code is as follows:
is a query pagePrivate Sub call_proc (ByVal num As String, ByVal cname As String, ByVal point As an Integer)
Dim cnum As String
Dim in_xh in_kch, in_cj 'stored procedure execution parameter

'according to the course of query,
Sqlcmd.Com mandType=adCmdUnknown
Sqlcmd.Com mandText="Select KCH from KCB where his='" + cname +"' "
The Set SqlRes=SQLCMD. Execute
If Not SqlRes. EOF Then
KCH cnum=SqlRes (" ")
End the If
If num & lt;> "" And cnum & lt;> "And" IsNumeric (point)=True Then
Sqlcmd.Com mandText="Cj_Data"
Sqlcmd.Com mandType=adCmdStoredProc
'additional parameter method is used to call a stored procedure
Set in_xh=SQLCMD. CreateParameter (" in_xh adChar, adParamInput, 6)
SQLCMD. The Parameters. Append (in_xh)
The Set in_kch=SQLCMD. CreateParameter (" in_kch, "adChar, adParamInput, 3)
SQLCMD. The Parameters. Append (in_kch)
The Set in_cj=SQLCMD. CreateParameter (" in_cj, "adInteger, adParamInput, 2)
SQLCMD. The Parameters. Append (in_cj)
The parameter '
In_xh SQLCMD (" ")=num
In_kch SQLCMD (" ")=cnum
In_cj SQLCMD (" ")=point
SQLCMD. Execute
'delete the parameter
SQLCMD. The Parameters. The delete (" in_XH ")
SQLCMD. The Parameters. The delete (" in_kch ") here this sentence error
SQLCMD. The Parameters. The delete (" in_cj ")
'
refresh cjADO spaceCjADO. RecordSource="select * from XS_KC_CJ where XH='" + num +"' "
CjADO. Refresh
The Else
MsgBox (" please input the correct result information ")
End the If

How to change, the previously defined type also right
  • Related