Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Sunday, March 25, 2012

ActiveX

I have to put some ActiveX code in the first step of a DTS package, which will search thru all the files in some folder and if it finds a file with filename starting with "Test" (like TestFile.txt), the script will rename it and then use it for transforming data to SQL tables.

In VB Dir$ function could have been used, what should I use in ActiveX?

Thanks a lot for your helpI'm not sure how to rename the file but you might be able to use the xp_fileexist extended proc to see if the file is in the directory.|||This is a start:

Function Main()

Dim objFSO
Dim objFolder
Dim objFile
Dim fileName
Dim folderName

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("\\server\share$\dir\")
folderName = "\\server\share$\dir\Archive\" & Month(Now) & Day(Now) & Year(Now) & "_" & Hour(Now) & Minute(Now) & Second(Now) & "\"

For Each objFile in objFolder.Files

objFSO.CreateFolder(folderName)

fileName = objFile.Path

objFSO.MoveFile fileName, folderName
Next

Main = DTSTaskExecResult_Success

End Function|||Now I'm getting what I need to do, thanks a lot for your help.sql

Monday, March 19, 2012

Active Directory groups / Permissions problems

We have a large group of users that need read access to a certain report folder. We have added the active directory group to the permissions for the entire folder, and all the reports inherit the folder's permissions.

About 75% of the people in the group CAN access the reports just fine. About 25 people cannot - they get the typical"The permissions granted to user 'DOMAIN\user' are insufficient for performing this operation."

Could someone point me in the right direction for debugging this problem? Is this a bug in Microsoft, or is this a "common" configuration problem where I can look at a couple of logs and change a couple of settings?

Any tips would be greatly appreciated

Sue

HiSue,

Do you use xp system? If so, you have to use impersonation, while on IIS6
and above you can use a domain account for the AppPool.

#Understanding ASP.NET Impersonation Security - Rick Strahl's Web Log
http://west-wind.com/weblog/posts/2153.aspx

Hope this helps.

|||

Rex:

Thank you for the tip. I do use IIS6, and the Reports Server web site, installed by the Reporting Services installer, already uses Impersonation.

Itried to change my application pool identity to a network service account, and it comes back saying I can't even browse the site, due to "Service Unavailable". The event logs seem to indicate that that service account doesn't have some security policy rights on the system, but I tried adding that account to "Log on Locally", "Log on as Service" and "Log on from Network" and none of that works.

We have also discovered that the domain group account that we added for security is listed in Active Directory as a "Distribution" type group and not a "Security" type group. I don't know if this makes a difference, but I'm going to see if we have a security group for these people.

Thanks
Sue

Tuesday, March 6, 2012

Accumulating snapshot folder

Hi all,
I found that my testing server is accumulating shapshot folder in repldata. Everytime, we refresh the tables (snapshot publication), a new folder created without the old folders. And I found that there is at most 1 snapshot folder remain in production server. Any parameter to adjust the retention period of the snapshot folder? Thanks in advanceWhat version of SQL Server are you using?|||MSSQL2005 SP2|||Retention setting can be adjusted in publication property.

accumulating shapshot folder in repldata

Hi all,
I found that my testing server is accumulating shapshot folder in repldata.
Everytime, we refresh the tables (snapshot publication), a new folder created
without the old folders. And I found that there is at most 1 snapshot
folder remain in production server. Any parameter to adjust the retention
period of the snapshot folder? Thanks in advance
It is normal to create a date stamped snapshot folder within your main
publication snapshot folder, for example within here
C:\Program Files\Microsoft SQL
Server\MSSQL.2\MSSQL\repldata\unc\Publisher_P2P1_P 2P1
These are normally cleaned up by one of the clean up jobs.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"stephanie" <stephanie@.discussions.microsoft.com> wrote in message
news:24DD103F-DFB5-4331-B04C-B2E3E9ECBB12@.microsoft.com...
> Hi all,
> I found that my testing server is accumulating shapshot folder in
> repldata.
> Everytime, we refresh the tables (snapshot publication), a new folder
> created
> without the old folders. And I found that there is at most 1 snapshot
> folder remain in production server. Any parameter to adjust the retention
> period of the snapshot folder? Thanks in advance
|||This should remain until the distribution retention period is reached (named
subscriber not yet initialized or anonymous subscribers enabled) or all
subscribers have been initialized. After that the cleanup agent will delete
the folder.
Paul Ibison
|||I found the distribution transaction retention is 1-12 hrs only and there is
2 snapshot folders generated more than 1 weeks ago. Any idea? Thanks a lot.
"Paul Ibison" wrote:

> This should remain until the distribution retention period is reached (named
> subscriber not yet initialized or anonymous subscribers enabled) or all
> subscribers have been initialized. After that the cleanup agent will delete
> the folder.
> Paul Ibison

Sunday, February 12, 2012

Accessing Report Parameters Class through Web Service

I am using ASP .NET along to render my reports. I've extended the web
service class such that I specify the report folder, and I get all
reports and their respective parameters. I then dyncamically create
the controls (such as datepicker, textbox, etc...) based on the
Parameter Name, and Type. The drop down list is the one giving me the
hardest time though.
My problem is this: I have a Report with 3 parameters. The first 2
are dates. I can retrive all info on them just fine. The name,
prompt, and type (datetime). The third parameter (AppUserKey) however
is a dropdown list of all the users. I wrote a stored procedure that
does this called spGetAppUsers. Here is the structure of this
parameter as per the RDL file:
</ReportParameters>
...
...
<ReportParameter Name="AppUserKey">
<DataType>Integer</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
</DataSetReference>
</DefaultValue>
<Prompt>AppUserKey</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
<LabelField>AppUserName</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
</ReportParameters>
I can get the Name, and even from the ValidValues, the ValueField and
LabelField, however, I want the <DataSetName> entry.
This is so that after I dynamically create the drop down list, I'm
able to populate it via the stored procedure. Recall that the
ReportParameter class is defined here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_ir_5zec.asp
ReportParameter::QueryParameter is a boolean property. Doesn't
actually return the name. Just whether or not you are using a query.
ReportParameter::DefaultValues is a string but is empty, since the
report hasn't executed the stored procedure (makes sense).
I want this to be a generic solution. Hence all this trouble to get
all the "givens" from the Report, and to reconstruct it in ASP .NET.
I need that DataSetName!!! :-S
Any help is appreciated.
Thanks for your time,
RoyThere are 2 ways to do what I want:
1. Instead of trying to get the stored procedure of my query based
parameter, I should've set forRendering = True in my
GetReportParameters function. That will actually return the query
based parameter set. Then I can populate the drop down list with that.
2. Load the .RDL (report definition in XML) in memory and use XPATH to
get the name of the parameter:
Dim reportDefinition As Byte() = Nothing
Dim doc As New System.Xml.XmlDocument
Try
reportDefinition = rs.GetReportDefinition(ReportsFolder &
strReportName)
Dim stream As New MemoryStream(reportDefinition)
doc.Load(stream)
In this scenario, assuming you have forRedering=True or False, you
still need to know the name of the parameter. So you'ld probably get
then name of the parameter and then check the value of QueryParameter
to see if it's true.
Then base your XPATH query on the following XML:
"/ReportParameter/ValidValues/DataSetReference/DataSetName[@.text]"
Or something similar. I forget. The above is proabably wrong and
could be written in a million different ways.
<ReportParameter Name="AppUserKey">
<DataType>Integer</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
</DataSetReference>
</DefaultValue>
<Prompt>AppUserKey</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
<LabelField>AppUserName</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
</ReportParameters>
Roy Assaly wrote:
> I am using ASP .NET along to render my reports. I've extended the
web
> service class such that I specify the report folder, and I get all
> reports and their respective parameters. I then dyncamically create
> the controls (such as datepicker, textbox, etc...) based on the
> Parameter Name, and Type. The drop down list is the one giving me
the
> hardest time though.
> My problem is this: I have a Report with 3 parameters. The first 2
> are dates. I can retrive all info on them just fine. The name,
> prompt, and type (datetime). The third parameter (AppUserKey)
however
> is a dropdown list of all the users. I wrote a stored procedure that
> does this called spGetAppUsers. Here is the structure of this
> parameter as per the RDL file:
> </ReportParameters>
> ...
> ...
> <ReportParameter Name="AppUserKey">
> <DataType>Integer</DataType>
> <DefaultValue>
> <DataSetReference>
> <DataSetName>spGetAppUsers</DataSetName>
> <ValueField>AppUserKey</ValueField>
> </DataSetReference>
> </DefaultValue>
> <Prompt>AppUserKey</Prompt>
> <ValidValues>
> <DataSetReference>
> <DataSetName>spGetAppUsers</DataSetName>
> <ValueField>AppUserKey</ValueField>
> <LabelField>AppUserName</LabelField>
> </DataSetReference>
> </ValidValues>
> </ReportParameter>
> </ReportParameters>
> I can get the Name, and even from the ValidValues, the ValueField and
> LabelField, however, I want the <DataSetName> entry.
> This is so that after I dynamically create the drop down list, I'm
> able to populate it via the stored procedure. Recall that the
> ReportParameter class is defined here:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_ir_5zec.asp
> ReportParameter::QueryParameter is a boolean property. Doesn't
> actually return the name. Just whether or not you are using a query.
> ReportParameter::DefaultValues is a string but is empty, since the
> report hasn't executed the stored procedure (makes sense).
> I want this to be a generic solution. Hence all this trouble to get
> all the "givens" from the Report, and to reconstruct it in ASP .NET.
> I need that DataSetName!!! :-S
> Any help is appreciated.
> Thanks for your time,
> Roy