这是程序的一段: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 & "" 是什么意思啊,能不能详细解释一下,谢啦,在线等。

解决方案 »

  1.   

    这个没意思.   是有些人的习惯.   trim(rsRecordSet!SmanCode )这样去掉空格更好.
      

  2.   

    是因为如果rsrecordset!smancode is null
    那么,这样附值好像会出错的。所以加上""
      

  3.   

    避免字段值为null时赋值给控件显示出错,同iif(isnull(rsrecordset!smancode),"",rsrecordset!smancode)
      

  4.   

    因为,如果该字段的值为空(Null)就会出错,所以在后面加上一个空字符串来避免。
    因为就算是空字符串也是有东西的,和NULL是不同的。
    楼主有兴趣可以看一下MSDN中关于:NULL, EMPTY, NOTHING,这三个东西的说明吧。
      

  5.   

    Text1.Text = rsRecordSet!SmanCode & ""
    相当于Text1.Text = rsRecordSet("SmanCode") & ""    
    Text2.Text = rsRecordSet!SalesMan & ""
     相当于
    Text2.Text = rsRecordSet(“SalesMan") & ""
      

  6.   

    Text2.Text = rsRecordSet(“SalesMan") & ""的作用是如果
    rsRecordSet(“SalesMan")返回是空值,系统不会报错