Thursday, March 8, 2012
CLR Integration Security
In BOL it is mentioned that we can control the access of users to file
system resources by using impersonation (WindowsIdentity.Impersonate).
Imagine I have a SP that creates a file on disk but the user sends the path
as a parameter. Although I can control the user to access only to particular
path, but how can I control the developer herself? As a DBA, I need to
control the developer while they can write their codes without using
"WindowsIdentity.Impersonate". If they don't do impersonation, they can work
under the security account of SQL Server.
I want to give permissions based on the user accounts that they log into
their Windows.
Thanks in advance,
LeilaLeila wrote:
> Hi,
> In BOL it is mentioned that we can control the access of users to file
> system resources by using impersonation (WindowsIdentity.Impersonate).
> Imagine I have a SP that creates a file on disk but the user sends the pat
h
> as a parameter. Although I can control the user to access only to particul
ar
> path, but how can I control the developer herself? As a DBA, I need to
> control the developer while they can write their codes without using
> "WindowsIdentity.Impersonate".
I do not really understand the question. What I mean is that; if the
developer writes the code without Impersonate, then everyone runs
without impersonation - so IMHO, it is not a question about dev vs.
regular users. If you are worried about dev doing things they shouldn't
do - well make sure they only have necessary rights on dev machines and
not production boxes.
> If they don't do impersonation, they can work
> under the security account of SQL Server.
> I want to give permissions based on the user accounts that they log into
> their Windows.
Well, I would assume that the account SQL runs under has very low
priviliges, and if you want to give rights according to the log-ins -
require that the code has Impersonate. Also, remember that running under
the account of SQL is only applied when you execute out of SQL Server,
i.e. file I/O etc.
Niels
Wednesday, March 7, 2012
Closing a connection created from a SQLDataSource
I have a simple form containing a FormView control. The FormView uses a SQLDataSource. This works fine and in 30 seconds I have a working form without writing any code.
A form built this way causes problems with connection pooling because I am not closing the connection. What is the best method for me to remedy this?
Every resource I've found explains that I have to explicitly close the connection. How do I do that in this case? Dispose the SQLDataSource in the FormView DataBound event? Rewrite the form so I can control opening and closing of the connection?
Thanks in advance.How about disconnecting on the page.OnUnload event?
Sunday, February 19, 2012
Client Side Print - An error occured during printing. (ox80070006)
Explorer I get the following error:
An error occured during printing. (ox80070006)
After some experimenting I found I was able to print (same client
computer / same server) to a file using the Generic / Text Only printer
driver and the Microsoft Office Document Image Writer.
So based on that I assumed the problem wasn't with the server.
Next I tried hooking my printer directly to my computer. The same
error occured.
I then tried a separate computer that printed to a separeate computer
and it worked.
Based on this I am assuming there is a issue with my printer / printer
driver and the ActiveX control.
My printer is a Samsung ML-1430.
I wanted to report this to the Reporting Services Team and see if
anyone else had any similar problems with other printers.
Thanks,
Warren Hales
P.S. I am new to Reporting Services and I have to say I am VERY
impressed. The Reporting Services Team has done a great job (IMHO).
It is an excellent example of an application with a SOA.Have you tried making sure you have a recent print driver? There have been
reports about printing problems going away once they updated the print
drivers.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Warren Hales" <warrenhales@.hotmail.com> wrote in message
news:1116604481.414270.179770@.g14g2000cwa.googlegroups.com...
> When trying to print a report using the ActiveX control in Internet
> Explorer I get the following error:
> An error occured during printing. (ox80070006)
> After some experimenting I found I was able to print (same client
> computer / same server) to a file using the Generic / Text Only printer
> driver and the Microsoft Office Document Image Writer.
> So based on that I assumed the problem wasn't with the server.
> Next I tried hooking my printer directly to my computer. The same
> error occured.
> I then tried a separate computer that printed to a separeate computer
> and it worked.
> Based on this I am assuming there is a issue with my printer / printer
> driver and the ActiveX control.
> My printer is a Samsung ML-1430.
> I wanted to report this to the Reporting Services Team and see if
> anyone else had any similar problems with other printers.
> Thanks,
> Warren Hales
> P.S. I am new to Reporting Services and I have to say I am VERY
> impressed. The Reporting Services Team has done a great job (IMHO).
> It is an excellent example of an application with a SOA.
>|||Hey Bruce.
I did download the latest print driver from Samsung and had the same
problem. I even tried a print driver from a compatible Samsung print
driver and that didn't work either.
One weird thing I found. If you click on the "printer" button in the
print dialog box, close it and then click print it gets a bit farther
along in the process. It prints a blank page and then shows the error
message.
Bruce L-C [MVP] wrote:
> Have you tried making sure you have a recent print driver? There have
been
> reports about printing problems going away once they updated the
> drivers.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Warren Hales" <warrenhales@.hotmail.com> wrote in message
> news:1116604481.414270.179770@.g14g2000cwa.googlegroups.com...
> > When trying to print a report using the ActiveX control in Internet
> > Explorer I get the following error:
> >
> > An error occured during printing. (ox80070006)
> >
> > After some experimenting I found I was able to print (same client
> > computer / same server) to a file using the Generic / Text Only
printer
> > driver and the Microsoft Office Document Image Writer.
> >
> > So based on that I assumed the problem wasn't with the server.
> >
> > Next I tried hooking my printer directly to my computer. The same
> > error occured.
> >
> > I then tried a separate computer that printed to a separeate
computer
> > and it worked.
> >
> > Based on this I am assuming there is a issue with my printer /
printer
> > driver and the ActiveX control.
> >
> > My printer is a Samsung ML-1430.
> >
> > I wanted to report this to the Reporting Services Team and see if
> > anyone else had any similar problems with other printers.
> >
> > Thanks,
> >
> > Warren Hales
> >
> > P.S. I am new to Reporting Services and I have to say I am VERY
> > impressed. The Reporting Services Team has done a great job
(IMHO).
> > It is an excellent example of an application with a SOA.
> >|||On of the problems might be the size of the print job that we send to the
printer. We are currently using a format called EMF + Dual which is pretty
hefty. We are looking whether we can trim it down in SQL 2005.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Warren Hales" <warrenhales@.hotmail.com> wrote in message
news:1116688171.637976.68360@.g47g2000cwa.googlegroups.com...
> Hey Bruce.
> I did download the latest print driver from Samsung and had the same
> problem. I even tried a print driver from a compatible Samsung print
> driver and that didn't work either.
> One weird thing I found. If you click on the "printer" button in the
> print dialog box, close it and then click print it gets a bit farther
> along in the process. It prints a blank page and then shows the error
> message.
> Bruce L-C [MVP] wrote:
>> Have you tried making sure you have a recent print driver? There have
> been
>> reports about printing problems going away once they updated the
>> drivers.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Warren Hales" <warrenhales@.hotmail.com> wrote in message
>> news:1116604481.414270.179770@.g14g2000cwa.googlegroups.com...
>> > When trying to print a report using the ActiveX control in Internet
>> > Explorer I get the following error:
>> >
>> > An error occured during printing. (ox80070006)
>> >
>> > After some experimenting I found I was able to print (same client
>> > computer / same server) to a file using the Generic / Text Only
> printer
>> > driver and the Microsoft Office Document Image Writer.
>> >
>> > So based on that I assumed the problem wasn't with the server.
>> >
>> > Next I tried hooking my printer directly to my computer. The same
>> > error occured.
>> >
>> > I then tried a separate computer that printed to a separeate
> computer
>> > and it worked.
>> >
>> > Based on this I am assuming there is a issue with my printer /
> printer
>> > driver and the ActiveX control.
>> >
>> > My printer is a Samsung ML-1430.
>> >
>> > I wanted to report this to the Reporting Services Team and see if
>> > anyone else had any similar problems with other printers.
>> >
>> > Thanks,
>> >
>> > Warren Hales
>> >
>> > P.S. I am new to Reporting Services and I have to say I am VERY
>> > impressed. The Reporting Services Team has done a great job
> (IMHO).
>> > It is an excellent example of an application with a SOA.
>> >
>|||FYI - I am seeing the same problem from one of our servers. The strange
thing is that I can print fine on two other servers that have SP2 installed
from the same reports on the same printers. One of the servers where the
printing is working was recently built (with SP2) and the other was upgraded
from SP1 to SP2 recently, so I can't see any pattern of when, where and why
this error is happening. It is failing on most of our reports that span 1
page (small reports as well as large ones). Any help is appreciated,
Brad Peterman
"Brian Welcker [MSFT]" wrote:
> On of the problems might be the size of the print job that we send to the
> printer. We are currently using a format called EMF + Dual which is pretty
> hefty. We are looking whether we can trim it down in SQL 2005.
> --
> Brian Welcker
> Group Program Manager
> Microsoft SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Warren Hales" <warrenhales@.hotmail.com> wrote in message
> news:1116688171.637976.68360@.g47g2000cwa.googlegroups.com...
> > Hey Bruce.
> >
> > I did download the latest print driver from Samsung and had the same
> > problem. I even tried a print driver from a compatible Samsung print
> > driver and that didn't work either.
> >
> > One weird thing I found. If you click on the "printer" button in the
> > print dialog box, close it and then click print it gets a bit farther
> > along in the process. It prints a blank page and then shows the error
> > message.
> >
> > Bruce L-C [MVP] wrote:
> >> Have you tried making sure you have a recent print driver? There have
> > been
> >> reports about printing problems going away once they updated the
> >> drivers.
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >> "Warren Hales" <warrenhales@.hotmail.com> wrote in message
> >> news:1116604481.414270.179770@.g14g2000cwa.googlegroups.com...
> >> > When trying to print a report using the ActiveX control in Internet
> >> > Explorer I get the following error:
> >> >
> >> > An error occured during printing. (ox80070006)
> >> >
> >> > After some experimenting I found I was able to print (same client
> >> > computer / same server) to a file using the Generic / Text Only
> > printer
> >> > driver and the Microsoft Office Document Image Writer.
> >> >
> >> > So based on that I assumed the problem wasn't with the server.
> >> >
> >> > Next I tried hooking my printer directly to my computer. The same
> >> > error occured.
> >> >
> >> > I then tried a separate computer that printed to a separeate
> > computer
> >> > and it worked.
> >> >
> >> > Based on this I am assuming there is a issue with my printer /
> > printer
> >> > driver and the ActiveX control.
> >> >
> >> > My printer is a Samsung ML-1430.
> >> >
> >> > I wanted to report this to the Reporting Services Team and see if
> >> > anyone else had any similar problems with other printers.
> >> >
> >> > Thanks,
> >> >
> >> > Warren Hales
> >> >
> >> > P.S. I am new to Reporting Services and I have to say I am VERY
> >> > impressed. The Reporting Services Team has done a great job
> > (IMHO).
> >> > It is an excellent example of an application with a SOA.
> >> >
> >
>
>
Thursday, February 16, 2012
Client Print To Dot Matrix Printer (Urgent)
But if I print those report to my laser printer or print them to dotmatrix printer in VS.NET, it's OK. See as below:
Print on laser priner
******************************
* * *
* * *
* *
* *
* *
******************************
Print on dotmatrix priner
======================================
= = =
= = =
= =
======================================
Is it a microsoft bug? Should I set something in my report or in printer driver (Printer Processer)?
Thanks in advance!
I'm having the same issue, did you get it working? Also wcich ActiveX control are you using?
Thanks
ma_flash
No, I still have this issue, whatever I changed the processer in printer driver, it did not work.
I'm using new ActiveX Control in Reporting Service SP2, it is downloaded from report server when first time user load report. I think it is not consistent with VS.NET, because I can print reports to dotmatrix printer in VS.NET propoerly, but not in ActiveX Control.
Can you kindly share the code of how to stream a report server directly to your local printer?
Thanks, Edmund