这是程序的一段:Private Sub LoadDataInControls()
If rsRecordSet.BOF = True Or rsRecordSet.EOF = True Then
Exit Sub
End If
Text1.Text = rsRecordSet!SmanCode & ""
Text2.Text = rsRecordSet!SalesMan & ""
End SubSmanCode 是用户号
SalesMan 是用户名 请问rsRecordSet!SmanCode & "" 是什么意思啊,能不能详细解释一下,谢啦,在线等。
If rsRecordSet.BOF = True Or rsRecordSet.EOF = True Then
Exit Sub
End If
Text1.Text = rsRecordSet!SmanCode & ""
Text2.Text = rsRecordSet!SalesMan & ""
End SubSmanCode 是用户号
SalesMan 是用户名 请问rsRecordSet!SmanCode & "" 是什么意思啊,能不能详细解释一下,谢啦,在线等。
那么,这样附值好像会出错的。所以加上""
因为就算是空字符串也是有东西的,和NULL是不同的。
楼主有兴趣可以看一下MSDN中关于:NULL, EMPTY, NOTHING,这三个东西的说明吧。
相当于Text1.Text = rsRecordSet("SmanCode") & ""
Text2.Text = rsRecordSet!SalesMan & ""
相当于
Text2.Text = rsRecordSet(“SalesMan") & ""
rsRecordSet(“SalesMan")返回是空值,系统不会报错