0
我正在使用VBScript处理传入的文本消息。我有一个条件,如果传入值低于数据库中的值,则会向发送者发送一条消息。由于某些原因,即使值较高,消息集仍然正在发送。小于或等于不工作
基本上,变量arrmessage
包含一个数字,例如300,然后将其与变量val
进行比较,该变量是数据库表中称为出价的最大值。因此,例如val = 10
。
当我放置arrmessage <= val then... elseif arrmessage > val then
它总是告诉我,arrmessage
低于val
,即使它更高。
Set objConn = CreateObject("ADODB.Connection")
set mycommand = CreateObject("ADODB.COMMAND")
objConn.Open "Provider=SQLOLEDB.1;Data Source=OFFICE-PC\SQLEXPRESS Initial Catalog=SMSSERVER","sa","Password1"
set highestbid = objConn.execute("select max(bid) from bid")
val = highestbid.fields(0).value
highestbid.close
IF arrmessage <= val then
strResponse = "Your bid is " & arrmessage & " and the highest bid is " & (val) & " you need to out bid the highest bidder"
elseif arrmessage > val then
'continue and insert bid in table
Set objConn = CreateObject("ADODB.Connection")
set mycommand = CreateObject("ADODB.COMMAND")
objConn.Open "Provider=SQLOLEDB.1;Data Source=OFFICE-PC\SQLEXPRESS; Initial Catalog=SMSSERVER","sa","Password1"
set mycommand = objConn.execute("update bid set bid='"& arrmessage & " 'where msisdn='" & objMessageIn.FromAddress & "'")
strResponse = "Thanks your bid of " & arrmessage & " has been recorded. To query the highest bid text keyword query"
else
你确定arrmessage和val都是数字,哪一个都不是字符串? –
'arrmessage'从哪里来?它可能是一个字符串? –
'MsgBox TypeName(arrmessage)'报告什么? – Bond