RE: ASP and SQL
am 03.02.2006 12:19:13 von Vexander
My mistake I want to use a view, not a stored procedure.
"Vexander" wrote:
> A few questions that might be followed with more. Firstly I want to run a
> stored procedure in an SQL server from a asp page. How this.
>
> Is there a way to create a user on an SQL server from a ASP page, and if
> there is is there a way to add that user to a group on in the SQL server.
>
> Thanx
Re: ASP and SQL
am 03.02.2006 12:45:36 von reb01501
Vexander wrote:
> My mistake I want to use a view, not a stored procedure.
>
> "Vexander" wrote:
>
>> A few questions that might be followed with more. Firstly I want to
>> run a stored procedure in an SQL server from a asp page. How this.
>>
>> Is there a way to create a user on an SQL server from a ASP page,
>> and if there is is there a way to add that user to a group on in the
>> SQL server.
>>
>> Thanx
For some reason, I did not see your original post. However, this followup
seems unnecessary because it is not really relevant to your question about
adding users via ADO from ASP.
Do you have SQL Books Online (BOL)? If so, look up the system stored
procedures for managing users. If not, you can download BOL from the
Microsoft web site:
http://www.microsoft.com/downloads/Browse.aspx?displaylang=e n&productID=261BA873-F3AB-420E-96D6-E3004596A551
You will need to use an account with sysadmin privileges in order to execute
these procedures from ASP. Just don't fall into the trap of using the sa
acount. Create a new account that has the needed privileges: never use the
sa account in client applications that may be breached.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Re: ASP and SQL
am 03.02.2006 12:57:46 von reb01501
Vexander wrote:
> My mistake I want to use a view, not a stored procedure.
>
> "Vexander" wrote:
>
>> A few questions that might be followed with more. Firstly I want to
>> run a stored procedure in an SQL server from a asp page. How this.
>>
>> Is there a way to create a user on an SQL server from a ASP page,
>> and if there is is there a way to add that user to a group on in the
>> SQL server.
>>
>> Thanx
Oh wait. I get it, there are two (actually 3) questions here. The first
(running stored procedures) is answered in this post:
http://tinyurl.com/jyy0
The second (how to use a view): you use a view in exactly the same way you
use a table: just create a query that names the view in the FROM clause. My
preference would be to create a stored procedure to encapsulate this, but,
others dislike stored procedures and prefer to use sql statements created in
code, either by dynamic sql (which is very insecure due to the dangers of
sql injection - see the above link - and prone to errors due to the
difficulties in handling delimiters) or by using parameter markers in the
sql string and using explicit command objects to pass values to the
statement (much more secure):
http://groups-beta.google.com/group/microsoft.public.inetser ver.asp.db/msg/72e36562fee7804e
I've already answered the third question :-)
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"