cmd.CommandText = "Select * From {医师资料} Where [姓名] = &UserName& "
应该是:
cmd.CommandText = "Select * From {医师资料} Where [姓名] = '" & UserName & "'"
建议看看:
http://www.foxtable.com/help/topics/1284.htm
http://www.foxtable.com/help/topics/1485.htm