ConnectString:
Provider=SQLOLEDB.1;Password=yang;Persist Security Info=True;User ID=sa;Initial Catalog=DotNetDB;Data Source=YANG
Provider=SQLOLEDB.1;Password=yang;Persist Security Info=True;User ID=sa;Initial Catalog=DotNetDB;Data Source=YANG
调试欢乐多
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User Id=myUsername;" & _
"Password=myPassword"
改为 server=YANG;uid=sa;pwd=yang;database=DotNetDB
上面是使用混合认证
NT认证的具体语法
data source=.;initial catalog=库名;integrated security=SSPI;persist security info=False;user id=ce;workstation id=CEN;packet size=4096
而且 数据库中还要注册ASP.NET用户
exec sp_grantlogin 'cen\ASPNET'
exec sp_grantdbaccess 'cen\ASPNET'
exec sp_addrolemember 'db_owner', 'cen\ASPNET'
如果使用
OleConnection 对象应该可以使用("Provider=SQLOLEDB;Password=yang;Persist Security Info=True;User ID=sa;Initial Catalog=DotNetDB;Data Source=YANG");