Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server & have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for

Cannot Access The File Because It Is Being Used By Another Process - Using ASPNETDB.MDF

I'm using Visual Web Developer 2005 Express, SQL Server 2005 and using the local file system as opposed to IIS for development purposes.

I will reference two pages of my site:  one that manages Types of Tours and one that downloads a Tour Registration Excel file.

On the Tour Types page, there is a sqldatasource that populates a DetailsView whose default mode is Insert.  On that same page I have a GridView that is populated from the same sqldatasource. The gridview has Paging, Editing and Deleting enabled.  There is no code behind on this page except for a prompt to the user to confirm the delete action if he has elected to delete a Tour Type.  This page works fine no problems.

On the download page, I have a prompt that allows the user to click a button to download the Tour Registration Excel file.  The code behind opens the Registration table in the ASPNETDB.mdf database, builds an .xls file via a streamwriter and prompts the user to download the file.

My problem:  if I start up VWD, go into my project, go straight to the download page without accessing any other pages, the download page works fine.  If I access any other pages first and then go to the download page, I get the error "System.Data.SqlClient.SqlException: Unable to open the physical file "C:....App_DataASPNETDB.MDF". Operating system error 32: "32(The process cannot access the file because it is being used by another process."  My simplified code behind is this:

Dim sw As System.IO.StreamWriter
Dim myConn As Data.SqlClient.SqlConnection, query As String, myCommand As Data.SqlClient.SqlCommand
Dim myReader As Data.SqlClient.SqlDataReader
Dim fileName As String, baseDirectory As String, fullFileName As String

fullFileName = baseDirectory & fileName
sw = New IO.StreamWriter(fullFileName)

myConn = New Data.SqlClient.SqlConnection("Persist Security Info=False;Integrated Security=true;AttachDbFileName=C:<pathnamehere>App_DataASPNETDB.mdf;database=ASPNET;Data Source=.SQLEXPRESS")

query = "SELECT Registrations.RegistrationNum, Registrations.Title, Registrations.LastName, Registrations.FirstName, Registrations.Organization, Registrations.StreetAddr1, Registrations.StreetAddr2, Registrations.City, Registrations.State, Registrations.Zip, Registrations.WorkPhone, Registrations.HomePhone, Registrations.CellPhone,, Registrations.AddToMailingList, Registrations.NumberInParty, Registrations.Comments, Registrations.DateRegistered, Registrations.TourDate, Registrations.TourFormattedTime, TourTypes.TourTypeDescr FROM Registrations INNER JOIN TourTypes ON Registrations.TourTypeNum = TourTypes.TourTypeNum"

myCommand = New Data.SqlClient.SqlCommand(query, myConn)

As soon as the code his the myConn.Open(), it abends with the above message.  I then have to close the project, and stop and re-start SQL Server.  HELP!!

View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
ASPNETDB.MDF: The Process Cannot Access The File Because It Is Being Used By Another Process
I'm trying to upload the ASPNETDB.MDF file to a hosting server via FTP, and everytime when it was uploaded half way(40% or 50%)
I would get an error message saying:
"550 ASPNETDB.MDF: The process cannot access the file because it is being used by another process"
 and then the upload failed.
 I'm using SQL Express. Does anybody know what's the cause?
 Thanks a lot

View Replies !   View Related
FCB::Open: Operating System Error 32(The Process Cannot Access The File Because It Is Being Used By Another Process.) Occurred W
Hello all,
I am running into an interesting scenario on my desktop.  I'm running developer edition on Windows XP Professional (9.00.3042.00 SP2 Developer Edition).  OS is autopatched via corporate policy and I saw some patches go in last week.  This machine is also a hand-me-down so I don't have a clean install of the databases on the machine but I am local admin.

So, starting last week after a forced remote reboot (also a policy) I noticed a few of the databases didn't start back up.  I chalked it up to the hard shutdown and went along my merry way.  Friday however I know I shut my machine down nicely and this morning when I booted up, I was in the same state I was last Wenesday.  7 of the 18 databases on my machine came up with

FCB:pen: Operating system error 32(The process cannot access the file because it is being used by another process.) occurred while creating or opening file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataTest.mdf'. Diagnose and correct the operating system error, and retry the operation.
and it also logs  
FCB:pen failed: Could not open file C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataTest.mdf for file number 1. OS error: 32(The process cannot access the file because it is being used by another process.).

I've caught references to the auto close feature being a possible culprit, no dice as the databases in question are set to False.  Recovery mode varies on the databases from Simple to Full.  If I cycle the SQL Server service, whatever transient issue it was having with those files is gone.  
As much as I'd love to disable the virus scanner, network security would not be amused.  The data and log files appear to have the same permissions as unaffected database files.  Nothing's set to read only or archive as I've caught on other forums as possible gremlins.  I have sufficient disk space and the databases are set for unrestricted growth.

Any thoughts on what I could look at?  If it was everything coming up in RECOVERY_PENDING it's make more sense to me than a hit or miss type of thing I'm experiencing now.

View Replies !   View Related
SQL Server 2K CmdExec Job Step Error 'The Process Cannot Access The File Because It Is Being Used By Another Process'
We have a nightly load process that uses scheduled SQL jobs on a SQL Server 2000 Standard Edition with SP4.  Though this process has been in place for years, recently we've been having certain CmdExec Job Steps fail with the error 'The process cannot access the file because it is being used by another process'.  The error has been occurring either on step 3 or 4 in the following sequence of job steps:
Step 1
EXEC sp_SomeReportingProcedure
Job step logging is turned on for this step and the output is written to SomeReportingProcedureEmail.txt
Step 2
EXEC xp_smtp_sendmail with attachment of SomeReportingProcedureEmail.txt
More on xp_smtp_sendmail at
Logged to JobName.log
Step 3
COPY JobName.log + SomeReportingProcedureEmail.txt JobName.log
Not logged
Step 4
COPY SomeReportingProcedureEmail.txt X:ReportFolder
Logged to JobName.log

My theory is that for SQL Agent, the logging to an Output File found on the Advanced tab of a job step does not lock or unlock a file as part of the normal flow of job steps.  In other words, the previous step's logging may not have completed by the time the following step has begun it's operation.
Personally, I don't like using the Advanced log for job steps in this manner, but that's the way things are done around here.  I'm trying to preserve this work flow with only minor tweaks, preferrably to the database server as a whole, but I'll do minor code changes if necessary.
Anyone else have this problem or have a better way to describe what's going on?
One possible work around is to just set the retry for these job steps to delay for a minute and then try the action again.  Any other suggestions?

View Replies !   View Related
Child Package Execution: Process Cannot Access The File It Is Being Used By Another Process
HI, I have a paent package that calls child package (out of process property is set to true) and I get the following error message when I execute it from BIDS:

Error while loading MyPackage.dtsx, the process cannot access the file it is being used by another process.


Why do I get this error? It appeared when I changed my PC for a new one that has Vista and therefore SP2. My BS2005 has been patched with the tow SP1 patches (SP1 for VS, SP1 for VS in Vista).


The reason I execute my package in BIDS is that we have a product made for SSIS and we want to demonstrate its use visually with SSIS. Any suggestion?


Thank you,


View Replies !   View Related, Database File, Process Cannot Access The File Because It Is Being Used By Another Process
Hi I am using VWD 2008, SQL Express 2005, Reporting Services, Win-XP, IIS5Basically let's say I have 2 pages:Page1: has a SQLDataSource control that populates a GridView from a table from a database file myDB.mdf  (no code behind)Page2: has a reportviewer control that show a report with data from the same table from myDB.mdf from the reportserver, (no code behind)I have attached myDB.mdf to the SQL Server Express using the SQL Server Management Studio Express.If I first open Page2 to display the ReportViewer it works ok. or using the Report ManagerNow this is the problem:If after that I try to open Page1 then a get an error message:Cannot open user default database. Login failed.Login failed for user 'myServerASPNET'. Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.Login failed for user 'myServerASPNET'.Then I have to restart the SQL Server to fix it,Now I can open Page1 ok, but if after this I try to open Page2 (ReportViewer) againThen I get this error:"      An error has occurred during report processing. o      Cannot create a connection to data source 'my_Datasource'.  &And this error if open the report using the report manager:"      An error has occurred during report processing. o      Cannot create a connection to data source 'my_Datasource'. §      Unable to open the physical file "C:InetpubwwwrootWebsiteApp_DatamyDB.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".  &Now if i check the Management Studio Express again, you can see that myDB.mdf was detached. It seems to be there by it has no Tables or definitions, so I have to attach it again..Do you know how to fix this?Thanks in advance,Ed

View Replies !   View Related
The Process Cannot Access The File Because It Is Being Used By Another Process.
Error: 0xC002F304 at Rename file 1, File System Task: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".
When running two File System Tasks after each other, with the same file, the file is still locked when running the second task. Resulting in an error: 0xC002F304 at Rename file 1, File System Task: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".

I found a workaround by addind a Execute Process Task before the second File System Task that pings to the localhost. This results in a 5 second delay, but there must be a better solution. Anyone?

View Replies !   View Related
The Process Cannot Access The File It Is Being Used By Another Process.
I have a File System Task Copy file operation to copy a file in an SSIS package.  The package when scheduled as a job fails with the following error:

The process cannot access the file 'C:ETLConsignmentAppleAppleRawFile.txt' because it is being used by another process.".

However when I right click on the package and execute it manually from the Integration Services it runs successfully without any problem.  I am not certain on how to resolve this issue any inputs will be much appreciated.



View Replies !   View Related
The Process Cannot Access The File Because It Is Being Used By Another Process.
While configuring log shipping using SQL 2000 Ent, the copy process failed with this message :

The process cannot access the file because it is being used by another process.

does anyone know what cause this ?

SAP R/3 is configured with the system, could this be the problem ?


View Replies !   View Related
The Process Cannot Access The File Because It Is Being Used

I am using a File System Task to delete the contents of a directory however there may be cases where a process is still using one of the files. What I want to do in these instances is to wait for a period of time and then retry the deletion.
Does anyone know of an easy way to implement this?

View Replies !   View Related
Cannot Access Backup File Because It Is Being Used By Another Process
I occasionally receive the following error on backups to a disk backup device.

BackupDiskFile::CreateMedia: Backup device 'F:MSSQLBACKUPFull_Backup.BAK' failed to create. Operating system error = 32(The process cannot access the file because it is being used by another process.).

There are no other jobs running that access this file during the backup. So nothing else should be trying to touch the backup file.

Rerunning the backup again seems to work so it does sound like something is accessing the backup file, I just can't figure out what.

The backup proc reinitializes the backup file each time it runs with the init parameter and then appends remaining backups with noinit. This error occurs on several different servers. Could there be a problem reinitializing the same backup device? It seems like a previous backup has not let go of the device.

I am running SQL 2000 SP2 on Windows 2000 SP2.

Any ideas?

View Replies !   View Related
Can't Open Aspnetdb.mdf File
I am fairly new to ASP.NET and MSSQL but when I run my website with memberships and roles everything seems to work perfectly!! NO PROBLEMS!! However when I try to go and actually open the ASPNETDB.MDF database file that was automatically created by VB when I added a login and sign up panel I get this Error Message
"An attempt to attach an auto-named database for file C:Documents and SettingsoxMy DocumentsMy Webs nsApp_DataASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."
I don't really know why I can't open this file. I have someone who is going to help with some extra database work but asked if I could open this database so he could see the structure of it.  I have a copy of the website as backup in another folder on my computer but even removing that backup does nothing in helping open the original. THANKS PLEASE HELP!

View Replies !   View Related
ASPNETDB.MDF I Need To Rename This File
I need to rename this db and be able to set a path to it. This is because my webhost places all SQL databases on a seperate drive. This is a shared drive with alot of other databases. There fore my ASPNETDB.MDF needs to be renamed and have a path assigned. This doesnt seem tro be taken care of in my web.config file? Can some one help in reasigning the default database name and pathway. my other databases were pretty straight forward.

View Replies !   View Related
How To Exploit The Aspnetdb.mdf File ?
I read the section related to membeship in the documentation and I have noticed that the aspnetdb.mdf file was generated on the fly. But how can I then exploit this file ? I have tried to access and create a new database with SqlServer 2005 Express but it didn't work. I manage it with the Database explorer of VWD 2005 Express, but why isn't it posssible with other database administration tools ?
Thanks a lot.

View Replies !   View Related
Moving The ASPNETDB.MDF File To Another Computer
Hi all!I have some problems with windows authentication.Asp made the file ASPNETDB.MDF. But I dont have SQL Server on the machine where the application will be deployed...So I have to move this file to another server, but I couldnt find any information about ASPNETDB.MDF connection string or somenthing like this.Is it possible to move this file or I have to make the authentication on my own, with my own database? I hope there is a solution to this problem!Many thanks! Regards!

View Replies !   View Related
An Attempt To Attach An Auto-named Database For File Aspnetdb.mdf
having exhaustively searched the forum and tried everything over the pas few days im still recieving :Error Caught in Application_Error eventError in: Message: An attempt to attach an auto-named database for file E:Inetpubwwwrootmvate.comWapCmsApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.Stack Trace:   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)   at System.Data.SqlClient.SqlConnection.Open()   at System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate)   at System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation)   at System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc)   at System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties)   at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)   at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)   at System.Configuration.SettingsBase.get_Item(String propertyName)   at System.Web.Profile.ProfileBase.GetInternal(String propertyName)   at System.Web.Profile.ProfileBase.get_Item(String propertyName)   at System.Web.Profile.ProfileGroupBase.GetPropertyValue(String propertyName)   at ProfileGroupUser.get_ClientID()   at InfoPage.Page_PreInit(Object sender, EventArgs e)   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)   at System.Web.UI.Page.OnPreInit(EventArgs e)   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)help and suggestions appreciated 

View Replies !   View Related
Why No Config.exe File In Book ASPnet 2.0 SBS By George Shepherd, To Install ASPNETDB Database?
For MS Press Book, ADO.NET 2.0 Step by Step, 2005 Edition by Rebecco Riordan, installing the code samples created a ConfigDB.exe file
under SampleDBs folder. Running this exe file created a AdoStepByStep into the Database
folder in SQL Server 2005 Express. 

However, for ASP.NET 2.0 Step by Step, 2005 Edition, by George Shepherd, there is no Config.exe to install the ASPNETDB SQL Server
2005 Express database. I right clicked the Database folder to 'Attach' the database.  But,
the database just showed a 'c: ASPNETDB.MDF filfe path as a name. Further, running
the aspx files in Chapters 7 and 12 showed a 'Timeout Expired' error msg, indicating
something wrong with accessing the SQL Server database.

How can I run the aspx files in Chapters 7 and 12?  How can I install the ASPNETDB?


View Replies !   View Related
Check File For Being Used By Some Other Process When Using Flat File Source
I am wondering how easy is to check for file locks and have our SSIS Package to wait until file has been release by the process which is using it.

Also, same question when we're writing to a Flat File (or Flat File Destination).


View Replies !   View Related
Unable To Open The Physical Mdf File Or Log File Because It Is Being Used By Another Process
Unable to open the physical mdf file or log file because it is being used by another process
I am trying to write a Windows Application using ASP.NET 2.0, C#2005 EXPRESS, and SQL 2005 EXPRESS.
I had followed the introductory video to create a connection to the Database using Windows Authentication, and use the wizard to create a dataset and checking all the tables in the database.
After that I dragged a table from the data source created from the above process. The Details Grid so created is able to perform update, delete and addition of records.
But when I went back to the database at my PC I wasn€™t able to connect to the database. And if I opened the database first and then load the windows application and perform some database operations and went back to the physical database I wasn€™t able to open the tables in the database.
The error message is that the physical database connection cannot open the .mdf file or log file because another process is using the database. I guess it refers to the Windows Application.
Is this normal? Will it have any implications after the application is deployed? I suppose that there isn€™t a scenario where a Windows application and a physical process will access the database at the same time.
Will appreciate some feedback and advice on this scenario and whether it is a problem.
 Thanks and regards

View Replies !   View Related
Moved Aspnetdb To SQL Server - What Permissions Do I Need To Give The ASP IIS Service Account For That? (Getting: Cannot Open Database &"aspnetdb&" Requested By The Login. The Login Failed.)
I am getting the error:
Cannot open database "aspnetdb" requested by the login. The login failed.
When I browse to my ASP.NET 3.5 LINQ web application on the IIS 6.0 server on Server 2003.
I imagine this is because while I granted SQL Server 2005 login and permissions to my database that the application stores its data in, I did NOT grant any rights to the service account the IIS Application Pool uses for its identity to the aspnetdb database on SQL Server which is where all my roles information is stored at.
My question is what are the MINIMUM permissions needed for this database so it can perform its roles related functions?
I'm using Windows Authentications with the SQL Role provider for authorization.
Thank you.
EDIT: I think I only need to open the aspnetdb database and add my login to the aspnet_Roles_FullAccess role.  Is that correct?

View Replies !   View Related
SQL Command To Process An Access Macro?
Here's the scenario. Using a campaigning applicaion for aneNewsletter. It writes to an Access table. I have an ASP web page thatwrites to another table. I chained 3 Access queries together into aMacro to copy that data to the campaigning table, give a numericidentifier to that record, and then delete all records with thatidentifier (in the 2nd table). This will keep the ASP > Access tableclean.The campaigning software allows for a pre-processing SQL command tobe run. I would like to automate the updating of the table byinitiating this Access Macro from the SQL command. Anyone have anyideas on the command/syntax?Thanks in advanceJasonJoin Bytes!

View Replies !   View Related
Calling Child Package Out Of Process Fails With Access Denied.
Has anyone ever used an Execute Package Task to call a child package, and the Execute Package Task's ExecuteOutOfProcess = True?  Unless the account it runs under is an Administrator on the box, it fails for me with "Error 0x80070005 while loading package file "C:program filesmicrosoft sql server90dtsPackagesETLFact_SalesTransaction_Tracking.dtsx". Access is denied."

This is eating up hours and hours of my time, time we can't afford.  Is anyone able to successfully call a child package out of process?

View Replies !   View Related
Checkpoint File Used By Another Process
I have an SSIS solution with 8 packages in it. I have checkpoint turned on with the 'If Exists' option. Each of the 8 packages have 8 separate checkpoint files specified.

One out of two runs will fail with one of the below errors:

The checkpoint file \xxxxxxxx  is locked by another process. This may occur if another instance of this package is currently executing. 

Checkpoint file \xxxxxxxx failed to open due to error 0x80070020 "The process cannot access the file because it is being used by another proces

I have checked all the settings and everything looks fine, looks like the problem is when you have many Control Flow tasks in a package and if two of them are completed at the same time and they try to write to this file one of them is unable to write and it fails.

This is causing the entire job to fail even though the control flow was successful.

Anyone encounter this issue? Any assistance is appreciated.


View Replies !   View Related
Process Of Generate Xml File

hi i was trying to generate a .xml file by using this command below

DECLARE @Table varchar(20),@filename varchar(50), @SQL nvarchar(4000)

SET @Table ='Authors'

SELECT TOP 1 @Filename = au_fname FROM Authors

SET @FileName = 'C:' + @Table+'_'+@FileName+ '.xml'

SELECT @FileName

DECLARE @Table varchar(20),@filename varchar(50), @SQL nvarchar(4000)

SET @Table ='Authors'

SELECT TOP 1 @Filename = au_fname FROM Authors

SET @FileName = 'C:' + @Table+'_'+@FileName+ '.xml'

SELECT @FileName

SET @SQL = 'EXEC master..xp_cmdshell '+ ''''+'bcp'+ ' "SELECT ''au_fname '' AS ''Name/First'', au_lname AS ''Name/Last '' FROM pubs.dbo.authors ORDER BY au_lname FOR XML PATH (''Books''), ROOT(''Authors''), TYPE, ELEMENTS " queryout '+ @FileName + ' -c -SlocalHost -Usa -P'+ ''' '



 i got an error saying

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near 'au_fname'.
i could no tfigure it out my mind window is closed.can any one help me put to find a bug.
many many thanks

View Replies !   View Related
OK, I just want to know if I can use SSIS to open one text file create a table with the info in
SQL Server. Then open another fixed length file and insert rows in this table. I want to do this from an application in .Net. for e.g. I have a file that says "Col1 String 20, Col2 String 20,". This will create a table "Table1" in database DB1. then it will open a text file that has 200 rows for Col1 and Col2 with fixed length as 20. The table will be filled with the rows in the second text file. I want to give the user the ability to select the above files and when he clicks submit, the table will be filled. Is it possible?

View Replies !   View Related
How Do I Use Execute Process Task To Zip A File/fo

i have designed DTS packages, I have a script component that picks up the 'Path' of a file stored.
The Path is a column in database and that obtained from OLEDB source.

now i need to zip the files in the path given above and than store it in some location. How do I do that?

View Replies !   View Related
Acces To A File That Is Locked By Another Process
I am writing a package to process perfmon logs. The issue I have come across is that the perfmon process holds onto the log file and SSIS fails because it wants to exclusive read access. Is there any way of getting SSIS to not take an exclusive read on the file.

I can read the file in notepad fine but not SSIS.

View Replies !   View Related
RA_Setup_IO [Bucket: 0] [slot: 0]: Process 4 Generated Access Violation; SQL Server Is Terminating T
dear friends/collegs:
for the past couple of weeks, we've been seeing:

SQL Server Error:
"kernel RA_Setup_IO [Bucket: 0] [slot: 0]: Process 4 generated access violation; SQL Server is terminating this process"

we're running SQL Server 6.5 sp4. on NT 4. sp3

View Replies !   View Related
Replication Error Process Could Not Read File HELP PLZ
I am getting this error on replication and don't know why. Any ideas?

The process could not read file '\NJRARSVR00E9d$sqldatasystemMSSQL$P001ReplD atauncNJRARSVR00E9$P001_PTR_PTR20040707104224s napshot.pre' due to OS error 5.

View Replies !   View Related
DTS File Import Process (Part Deux)
Thanks to Troy Weigold and the code of Darren Green to address my last issue. Now we've gone deeper beyond my DTS knowledge. Is there a way to move a Text Import Object from one DTS package to another without loosing the formatting information. (I have quite a few of these from testing and now need to create production worthy packages and they have upwards of 100 columns split out in a fixed field format already.) If anyone has an idea so I don't loose my formatting it would be greatly appreciated.

Thanks in advance for your help!

Todd R.

View Replies !   View Related
File System Task Error - Process In Use

In the integration services package i'm working on i connect to an excel database and have two data flows which deal with two work sheets in the excel spreadsheet. The data flows do some transformation and then write the data out to a SQL database (two differnet tables). This is all working great however what i want to do once both data flows are complete is to move the directory which contains the current file that is being looped through. At present there is a foreach loop going through a number of directories. I have tried to implement the File System Task object to move the directory but get the following error:

[File System Task] Error: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".

I've read a similar post where by the problem was due to not closing the excel connection before doing the File System Task. I cannot seem to find where i would be able to do this.

If anyone has any ideas i'm looking forward to hearing them.

Many thanks in advance,


View Replies !   View Related
How To Ensure All The Process In A Batch File Is Completed?
I have a SSIS package with the last three tasks in the control flow are stopping the SSAS, then "on success" the second last task is execute a batch file to copy a bunch of files to a remote server using the robocopy command, then "on success" the last task is to start the SSAS. I test all three tasks individually and they are all working fine. The problem is in-between the second last task and the last task, the second last task is to execute a batch file and then forward to the last task. The task just moved to the last task once the batch file is executed and it did not wait until the actual robocopy job is completed. Therefore it caused a problem in the robocopy process. Thanks.

View Replies !   View Related
Replication : The Process Coule Not Read File????
Hi.everyone.I use two computer in workgroup.I use A to be a publisher and distributor ,B to a Subscrible.When i create a snop in A computer and Create snopshot in "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQL
epldataunc",when I use "view Synchronization Status" in B computer, the show "job already  success start",but in A computer sqlserver error log show "Message
Replication-: agent LIUQINASERVER2005-TestTran-Tran-LIUQIANHOMEHOME-6 failed. The process could not read file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLReplDatauncLIUQINA$SERVER2005_TESTTRAN_TRAN20070409150285ame_2.pre' due to OS error 3.".  The publisher snapshot agent is servernameadministrator.

I find a lot of message in internet ,but no one can help me .I try use same account and password in two computer.but no help.

Please tell me why and how to solve it ? Thanks.

View Replies !   View Related
Execute Command Process - Remote Batch File?
Good afternoon-  
Can a batch file that resides on another server be executed from a different machine? I have a batch file that resides on a server that I would like to run using SQL 2005 Integration Services. Is there anything I can do that would allow me to remotely execute this batch file and have it run in that environment. 

cd C:Trandev
otrun -at OTRecogn.att -DINPUT_FILE=%1 -tl 1 -cs dv -lg mylog -I
C:Trandev represents the  remote environment 

I have tried mapping the remote machine to a network drive on my local machine and using that drive to execute the batch file in an Execute Process Task,  but it does not work.


I have a FOR EACH loop grabbing files and writing fileName to a variable that is passed to the Process Task as an argument through an expression(%1 in the batch file above). The Working Directory is a mapped network drive. The Executable is also a network drive plus batch file name.

Any help would be appreciated.
My computer is a HP Compaq dc7100, 512mb RAM, WindowsXP

View Replies !   View Related
SSIS Package And Process Task (Batch File)
Trying to run a SSIS package from a SQL job, and the package itself has a step that calls a process task that runs a batch file.  The syntax in the process task I have is the following:

executable:  c:windowssystem32cmd.exe
Arguments:  /C e:SungardPTAencryptfile.bat
Working Directory:  e:sungardpta
I keep getting the following in my log:
PackageStart,MIMKEIMC11N,MI rustserviceadmin,PTADailyTransactionExtract,{46F7381F-B345-47DC-BFC0-17CCF02A935A},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:11 PM,1/29/2008 1:59:11 PM,0,0x,Beginning of package execution.
OnError,MIMKEIMC11N,MI rustserviceadmin,EncryptFiles,{FCF5B653-CC05-4183-981B-F5EF4906DD09},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,-1073573551,0x,In Executing "c:windowssystem32cmd.exe" "/C e:SungardPTAencryptfile.bat" at "e:sungardpta", The process exit code was "1" while the expected was "0".
OnError,MIMKEIMC11N,MI rustserviceadmin,PTADailyTransactionExtract,{46F7381F-B345-47DC-BFC0-17CCF02A935A},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,-1073573551,0x,In Executing "c:windowssystem32cmd.exe" "/C e:SungardPTAencryptfile.bat" at "e:sungardpta", The process exit code was "1" while the expected was "0".
OnTaskFailed,MIMKEIMC11N,MI rustserviceadmin,EncryptFiles,{FCF5B653-CC05-4183-981B-F5EF4906DD09},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,0,0x,(null)
PackageEnd,MIMKEIMC11N,MI rustserviceadmin,PTADailyTransactionExtract,{46F7381F-B345-47DC-BFC0-17CCF02A935A},{F82C7944-D28C-4F70-8CB7-F0BD7ED748D2},1/29/2008 1:59:12 PM,1/29/2008 1:59:12 PM,1,0x,End of package execution.

Any help would be greatly appreciated

View Replies !   View Related
Does MS Access Installation Is Required For Running Application That Uses Access Mdb File

I am developing an application that uses Access database (mdb file) to store the user data. The user of this application is not interested in the database file (to view in MS Access Environment). Does the user machine requires MS Access installation to run my application or just some couple of dlls (OleDB driver, Access DB Engine,..) should be enough to run my application?




View Replies !   View Related
How Can I Always Close A Text File From A CLR Stored Procedure Even When The Process Is Killed?
I have a C# SQL 2005 .net stored procedure which scrubs a text file looking for characters not in a range of characters and replacing them with another character.  This works fine except when the process is killed.  When this happens the file handle of the file being scrubbed is not released.  I use a try catch finally block when opening the file and the output file.  The finally section fiushes the output file and closes all files and streams but still when I go to access the file again or use the file in explorer it says the file is still in use.  Should I be handling this some other way?  How do I know the files will always be closed correctly.

View Replies !   View Related
Calling Remote Batch File Using 'Execute Process Task'
I have a remote batch file on machine B that I need to execute using 'Execute process task' control from a package on machine A. The batch file uses pgp software and encrypts a file sitting on machine B itself. The reason why my batch file is sitting on machine B, is because the PGP software is on machine B.

If I execute the batch file by itself from machine B, the script runs fine. I refer the same batch file as a UNC path from my package on machine A. But that does not work since the 'Working directory' is still machine A. I can not set machine B's folder as the working dir because it does not accept UNC path. So I say, ok , let me map a path to that UNC location and map it as drive 'Z:'. Certainly if I do so, I will be running the process on machine A and the batch file will look for the pgp software on machine A, and hence fail.

I have tried third party remote batch execution tools (PSEXEC) but have not had success, not because of SSIS limitations, but simply because the PGP executable when run through the PSEXEC tool, does not identify the location of the public keys on machine B and hence gives an encrytion failure.

How do I get the remote batch file to execute such that it executes with its own env? Is there a better remote execution tool I can try or are there any other features of SSIS I can use to get around this issue? I need the results of the batch file and hence do not want to make it an asyncronous process.



View Replies !   View Related
Execute Process Task -- Redirect Standard Output To A File, Not A Variable
I'm trying to use "findstr.exe" to extract some lines of interest from a data file, which I will later load to a table.  I'd like to issue this form of a command:


findstr.exe "^SEARCHSTRING" "srcfile" > "dstfile"


I build the arguments using expressions, and both the search string and source file get correctly set.  However, the ">" seems to be ignored--I can see the lines spitting out to the temporary window when I run under VS. 


QUESTION:  how do you redirect the output of a command run under an Execute Process Task?



View Replies !   View Related
Fail Execute Process Task Based On Batch File ERRORLEVEL?
I am new to this, but have scoured the web and not found an answer to my question...

I have an execute process task that runs a simple batch file.  When this batch file completes with an ERRORLEVEL greater than 0, I would like the task to fail.  I thought this simply meant setting the "FailTaskIfReturnCodeIsNotSuccessValue" property to true, and setting the SuccessValue to 0.  However, this does not appear to work. 

Even with a simple batch file forcing the errorcode to 1 as follows, the task still completes "successfully".


Any ideas?  Thanks!

View Replies !   View Related
Access To The Database File Is Not Allowed. [ File Name = ],[,,] Happens In VS2005 Environ But SSMSE Is Ok?
I am developing a C# mobile 5.0SDK app that utilizes SQL2005 Compact Edition device files on Vista using as far as I know the latest SPs and versions. 


Last night, I could open tables from the Server Explorer .sdf file, see the contents, edit the schema, etc.  Now today, I assume all of a sudden,I am able to open schema but cannot open the table to see the contents.  I get:


Microsoft SQL Server 2005 Compact Edition  captioned error dialog box that says "Access to the database file is not allowed. [ File name = ],[,,]


Using Sql Server 2005 Management Studio Express, I can open the table, do queries etc.  I have tried rebooting, deleting, opening old projects, deleting dataset, disconnecting mobile device, but I still get the same error.  I have tried stopping the SQL Server(SQLEXPRESS) service on the server but get:


Cannot open MSSLQ$SQLEXPRESS service on computer 'p5w64'. Access is denied.


I have no idea what to do next to start moving forward again, other than try the XP environment which I will do next.


Has anyone experienced this problem?


Thank you.





View Replies !   View Related
Converting Mdb (Access File) File To A SQL Server Database

I'm not really sure my question belongs to here...
I have a database in Access (from microsoft office, of course), and I want to transfer convert it to SQL Server.
Does anyone know how I can do it? It must be very simple, but I haven't found it yet....
Thanks a lot!
- Miri

View Replies !   View Related
&&"Transaction (Process ID 135) Was Deadlocked On Lock Resources With Another Process And Has Been Chosen As The Deadlock Victim.

I was trying to extract data from the source server using OLEDB Source and SQL Server Destination  when i encountered this error:
"Transaction (Process ID 135) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.".
What must be done so that even if the table being queried is locked, i wouldn't experience any deadlock?

View Replies !   View Related
Transaction (Process ID 66) Was Deadlocked On Lock Resources With Another Process.
Hi Folks,

I am having this table locking issue that I need to start paying attention to as its getting more frequent.

The problem is that the data in the tables is live finance data that needs to be changed and viewed almost real time so what I have picked up so far is that using 'table Hints' may not be a good idea.

I have a guy at work telling me that introducing a data access layer is the only way to solve this, I am not convinced but havnt enough knowledge to back my own feeling up. (asp system not .net).

Thanks in advance

View Replies !   View Related
ADO Process Doesn't Die Directly + One Process Per Select?
I'm running a tiny ASP application which opens a recordset
( set rs = Server.CreateObject("ADODB.Recordset") ) ,
which works fine.

Before terminating, I do:

set rs = Nothing

It seems like it takes some time (some seconds) after the last two statements have been executed before the process dies.

Further, it seems like there's one process created for each
"Select" I do with the same recordset (I do the Close and
a new Open for each Select).

Are these two things as expected?

BR Coolberg

View Replies !   View Related
Identifying Process Consuming Process - Urgent

Intermittenly the database performance goes down, If I monitor through performance monitor, I could see the processor time is high and SQL compilations is also high.

Could you please tell me how to find out which process/sql is the culprit. Is there any trace facility.

John Jayaseelan

View Replies !   View Related
Cannot Process Request Because The Process (3880) Has Exited.

Hi. When I try to start a package manually clicking the Start Debugging button I get this after a little while:

Cannot process request because the process (3880) has exited. (Microsoft.DataTransformationServices.VsIntegration)
How can I prevent this from happening? This happens every time I want to start the package and
every time the process id is different. Here it is 3880.

View Replies !   View Related
System Process Or User Process
select * from sysprocesses
How can I determine whether a process a system or user?

View Replies !   View Related
Identify A Process Which Locked Other Process


I have had a full lock on my sql server and I have a few logs to found the origin of the lock.

I know the process at the head of the lock is the 55 process.


Here are the information I have on this process:
Spid                 55                                            55
ecid                  5                                             5
Ecid                 0                                             0
ObjId                0                                             1784601646
IndId                 0                                             0
Type                 DB                                           PAG
Resource                                                         1:1976242
Mode                S                                             IS
Status TransID GRANT                          GRANT
TransID 0                                             16980
TransUOW        00000000-0000-0000-0000-000000000000
lastwaittype                  PAGEIOLATCH_SH
CMD                            AWAITING COMMAND
Physycal id                  1059       
Login time                    2007-07-05 04:29:53.873
nat address                  DFF06EBF974D
Wait type                     0x0046
HostName                    .
BlkBy                           .
DBName                      grpprddb
CPUTime                      54331  
DiskIO              1059

Would someone know a way to identify the origin of the process 55?

I have already tried to execute the following request:
select * from SYSOBJECTS
where id=1784601646

But I have had no returns.




View Replies !   View Related
DTS Access File To Access File With SQL 7
I set up a local package as a preliminary test to move a table from one shared directory Access 2000 file to another shared directory Access 2000 file. As long as I run it in the opened package screen it works fine. If I close the package and schedule it it errors right away. Anyone have a suggestion?

View Replies !   View Related
Can Not Access File
Using ssis, is it possible to refresh the data inside an excel file which is sitting on a separate machine (i.e. machine B) on the network?
When I try this using the importy wizard, the error message is:
The microdoft jet database engine can not open the file \pathnamedata.xls. It is already opened exclusively by another user, or you need permission to view it's data.

I have checked and the file is closed. No excel is running when checking the processes.
I have given myself full permission on that file from that machine where data.xls is sitting.

View Replies !   View Related

Copyright © 2005-08, All rights reserved