"select * from users where username='"+u+"' and password='"+p+"'";
你这是在C#里面的
如果在VB中这样写
"select * from users where username='"&u&"' and password='"&p&"'";
字符串变量,要用单引号括起来
String sql="select * from users where username='" + u + "' and password='" + p + "'";