Hi
I created an standard login and user and followed theses steps and there was no problem
and at result my created table belongs to 'user1'.
but in 2th try when I wnated to create a windows NT login and followed the 2th steps there
was a problem for me.this problem is : it shows at last step that my table belongs to 'sa' not to 'urezvani' which
created this table!!!!!! but in 1th try there's no problem and it shows the table 't113' belongs to 'user1'
so, what's wrong here?
1th try -----> with success
in Osql:
exec sp_addlogin 'login1'
exec sp_adduser 'login1','user1','db_owner'
in VB:
Set con = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Set cmd = CreateObject("adodb.command")
' Connect to Database
con.ConnectionString = "driver={SQL Server};server=parskhazar3;uid=login1;pwd=;database=productstock"
con.Open
sql1 = "create table t113(f1 char(1),f2 char(2));"
cmd.ActiveConnection = con
cmd.CommandText = sql1
cmd.CommandType = adCmdText
cmd.Execute
in Osql:
exec sp_tables 't113';
table_owner ..........
--------------------
user1
2th try -----------> not my excepted result!!!!
in Osql:
exec sp_addlogin 'khazar2.com\rezvani'
exec sp_adduser 'khazar2.com\rezvani','urezvani','db_owner'
successed
in VB:
Set con = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
Set cmd = CreateObject("adodb.command")
' Connect to Database sql1 = "create table t113(f1 char(1),f2 char(2));" ( **** successed******) in Osql: table_owner .......... Thanks
con.ConnectionString = "driver={SQL Server};server=parskhazar3;uid=khazar2.com\rezvani;pwd=;database=productsto
con.Open
cmd.ActiveConnection = con
cmd.CommandText = sql1
cmd.CommandType = adCmdText
cmd.Execute
exec sp_tables 't113';
--------------------
sa