Newbie question
Following script works OK against a SQL Server 2005
CREATE LOGIN [LoginX] WITH PASSWORD = 'PasswordX',DEFAULT_DATABASE=[DBX]
But against a SQL Server 2000 I get "Incorrect syntax near 'LOGIN'."
How do I change the script to work for 2000?
/BroedenBroeden wrote:
> Newbie question
> Following script works OK against a SQL Server 2005
> CREATE LOGIN [LoginX] WITH PASSWORD => 'PasswordX',DEFAULT_DATABASE=[DBX]
> But against a SQL Server 2000 I get "Incorrect syntax near 'LOGIN'."
> How do I change the script to work for 2000?
> /Broeden
>
look in BOL for sp_addlogin:
sp_addlogin [ @.loginame = ] 'login'
[ , [ @.passwd = ] 'password' ]
[ , [ @.defdb = ] 'database' ]
[ , [ @.deflanguage = ] 'language' ]
[ , [ @.sid = ] sid ]
[ , [ @.encryptopt= ] 'encryption_option' ]
Showing posts with label logon. Show all posts
Showing posts with label logon. Show all posts
Wednesday, March 7, 2012
Create Login form(authenticate with sql)
Hi all.
M trying to create a logon form
I had something in mind but i can work it out yet
When the user wants to login into the application the value of textbox must be compared with the datafield in the sql server.
And then i want a messagebox to show up.
I created a table in sql server with 2 fields in it , User and Password.
I hope anyone could help me tnx already
You will need a login which is able to access the table or a stored procedure which does the check of the login for you. Then its up to you to either raise an error from your stored procedure or return a specific result fromthe stored procedure which is transformed into a user friendly message like "Password wrong" or "Username / password combination wrong".HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
Subscribe to:
Posts (Atom)