Showing posts with label username. Show all posts
Showing posts with label username. Show all posts

Monday, March 19, 2012

How to set up a username and password for MSDE

Hi,

I have installed MSDE using the following parameter:

commandline> setup SAPWD="MySAPwd"

now all was set up... when i opened the osql utility..i wasnt able to login... it kept asking me the login name ans password...

i entered my windows login name which is 'home' and entered 'kham00s' as the password... it didnt work... then i entered my windows login name again which is 'home' and entered 'OTHERPASSWORD' as the password which is my system password...but did not work either...

then i logged in using :

commandline> osql -E

It successfully logged in... and i was able to create databases and tables...

can someone tell me how to set a username and password for MSDE please... so that i can connect to MSDE using WebMatrix...

i m coming from a PHP/MySQL background so i know SQL and stuff... but dont know how to handle and configure MSSQL...

waiting for the response..
thanks in advance...
Bye.
Kamran.The SAPWD option sets the sa users password, and so you need to use a username of sa and the password you supplied.

I edited your message so that your passwaords are not visible...|||thanks douglas! :)

But can you plz tell me what is my sa username? i read the term 'sa' a lot in the msdn library but couldnt figure out what it means... it wud be gr8 if i get to know what is 'sa'...

btw thanks for editing...but the passwords i entered were not the real ones. ;)

looking forward to replies.. thanks...|||The sa password is 'sa' (without the quotes).|||thanks again...

but that isnt working either...

after installation.. i do this:

commandline> osql -U sa -P "mypwd"

also tried this:

commandline> osql -U sa -P mypwd

and this:

commandline> osql -U sa
enter password: (keyboard hits)

but doesnt connect either... tells me that 'sa' is an unknown user... etc...

plz help me... i can connect using the -E parameter...but i need to connect to MSDE using ASP.net Web Matrix... so plz help... many thanks...

regards,
Kamran.|||Here is the procedure for adding a user to a database (from the "Microsoft ASP.NET Programming C# .NET" book):

When you installed your .NET IDE, it should have set up an ASPNET Windows user account. ASP.NET is configured by default to use the unprivileged ASPNET account to run ASP.NET worker processes.

1)
comline: osql -E

2)
grant login access to the ASPNET account. <domain> is your local machine name.
1> sp_grantlogin '<domain>\ASPNET'
2> go

3)
call the sp_defaultdb system stored procedure to change the default database to the database you want ASPNET to use.
1> sp_defaultdb '<domain>\ASPNET', '<yourdatabasename>'
2> go

4)
add the ASPNET account to the db_datareader role.
1> sp_adduser '<domain>\ASPNET', 'ASPNET', 'db_datareader'
2> go

5)
to add ASPNET to the db_datawriter role, do:
1> sp_addrolemember 'db_datawriter', 'ASPNET'
2> go|||thanks everyone...

all is working fine now... thanks to douglas and dran001...

i m able to ger web matrix connect to the database...

btw i m unable to connect through web data administrator... thankx anyways...

i hav no probs 'inserting' using OSQL...

regards,
Kamran.

Monday, March 12, 2012

How to set the current connectionString user as a defualt value?

Hi,

I'm using username & password in my connectionString to connect my program (C#.net) with Sql Server 2005..

I put in defualt value in one feild: user_name()

it replace the user: dbo, not the user which I used in my connectionString.

so.. how to get this user?

I tried to put: currnet_user

but I get the same result, "dbo" not the user in my connectionString..

I tried SESSION_USER, it gave the same result :(|||

This is my connectionString:

connectionString="Provider=SQLOLEDB;Data Source=LEWEHSBF\LEWEENG;Persist Security Info=True;Password=HsBfL4w4;User ID=Lewe;Initial Catalog=MyDatabase"

|||

I think the resone is the user I which I used in myConnectionString, is Admin user, I tried with "dataread, datawrite" user and its worked..

Thank you myself