Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts

Tuesday, March 20, 2012

Can not attach SQL Server 2005 Express database

I got the folllowin error while trying to attach database. The directory is there...

TITLE: Locate Database Files - H001335\SQLEXPRESS

C:\Documents and Settings\Administrator.H001335\My Documents\Visual Studio 2005\WebSites\Import\App_Data
Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.

If you know that the service account can access a specific file, type in the full path for the file in the File Name control in the Locate dialog box.


BUTTONS:

OK

Moving thread to a more appropriate forum.|||where is it?|||please help, no idea why I can't attach this database|||Make sure you do not have VS open (as server manager creates a connection to sql server), and try stopping and restarting the sqlserver agen service. Then try to attach the database. Is the nme the same as the db name? You may need to copy over the log file aswell (daname_log.ldf).|||

Are you using "User Instance=True" in your connection string?

If so, you need to make sure that the user who is running the task has appropriate permissions to access files in that directory (by the looks ASPNET might be the user).

If you're not, then I try running the the sql server service as "Local System" instead of the default "Network Service", or give "Network Service" appropriate permissions for that location.

|||Yes you are right, seems this was related to the user ASP.NEt not having enough rights in the directory...

Can not attach SQL Server 2005 Express database

I got the folllowin error while trying to attach database. The directory is there...

TITLE: Locate Database Files - H001335\SQLEXPRESS

C:\Documents and Settings\Administrator.H001335\My Documents\Visual Studio 2005\WebSites\Import\App_Data
Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.

If you know that the service account can access a specific file, type in the full path for the file in the File Name control in the Locate dialog box.


BUTTONS:

OK

Moving thread to a more appropriate forum.|||where is it?|||please help, no idea why I can't attach this database|||Make sure you do not have VS open (as server manager creates a connection to sql server), and try stopping and restarting the sqlserver agen service. Then try to attach the database. Is the nme the same as the db name? You may need to copy over the log file aswell (daname_log.ldf).|||

Are you using "User Instance=True" in your connection string?

If so, you need to make sure that the user who is running the task has appropriate permissions to access files in that directory (by the looks ASPNET might be the user).

If you're not, then I try running the the sql server service as "Local System" instead of the default "Network Service", or give "Network Service" appropriate permissions for that location.

|||Yes you are right, seems this was related to the user ASP.NEt not having enough rights in the directory...sql

Can not attach SQL Server 2005 Express database

I got the folllowin error while trying to attach database. The directory is there...

TITLE: Locate Database Files - H001335\SQLEXPRESS

C:\Documents and Settings\Administrator.H001335\My Documents\Visual Studio 2005\WebSites\Import\App_Data
Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.

If you know that the service account can access a specific file, type in the full path for the file in the File Name control in the Locate dialog box.


BUTTONS:

OK

Moving thread to a more appropriate forum.|||where is it?|||please help, no idea why I can't attach this database|||Make sure you do not have VS open (as server manager creates a connection to sql server), and try stopping and restarting the sqlserver agen service. Then try to attach the database. Is the nme the same as the db name? You may need to copy over the log file aswell (daname_log.ldf).|||

Are you using "User Instance=True" in your connection string?

If so, you need to make sure that the user who is running the task has appropriate permissions to access files in that directory (by the looks ASPNET might be the user).

If you're not, then I try running the the sql server service as "Local System" instead of the default "Network Service", or give "Network Service" appropriate permissions for that location.

|||Yes you are right, seems this was related to the user ASP.NEt not having enough rights in the directory...

Monday, March 19, 2012

Can no longer get dataset fill method to work after directory copy

I have been creating a small winforms app using VS 2005 and SQL Express. I
create serveral tables in the database and added it as the datasource for th
e
project. I created several forms, created several datagrids and regular
design views. After I got several of the forms running, I decided to backup
my directory and copied the entire directory to a backup directory on my har
d
drive.
While continuing to work on my project, the IDE lost some of the data
adapters and and datasets while I was switching between the design view and
code view. So I decided to delete the directory and copy the backup I had
saved and start from there. But a Big Problem occured. Once I opned the
project and tried to execute it, I could no longer get the app to connect to
the database. I am the only user and administrator account but every time th
e
app tries to fill a table now I get on of these two erors:
System.Data.SqlClient.SqlException was unhandled
Message="Unable to open the physical file -- ". Operating system error
5: \"5(Access is denied.)\".\r\nUnable to open the physical file
or
System.Data.SqlClient.SqlException was unhandled
Message="Cannot open user default database. Login failed.\r\nLogin failed
for user
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=11
LineNumber=65536
Number=4064
Procedure=""
Server=".\\SQLEXPRESS"
State=1
StackTrace:
I can no longer connect to the database even thou I can see and work with it
in the IDE. Help
HWDotNetDeveloperSeveral possible reasons for this:
1) you did not restore your original LDF file with your matching MDF
2) you have not re-attached the database
3) you are trying to connect using an sql user account and it is not config
ured the same with the "backed" up version
4) you are trying to connect without the correct user instance reference (i
e. the backed up version is different from the one you deleted)
If you can see the database from the IDE, then using query analyzer and run
a test query. You can also start OSQL and run a simple query against the da
tabase. If these queries work, then there is something not synchronized wit
hin your code versus the database that was restored.
Check out
http://msdn.microsoft.com/library/d...>
userinst.asp
Hope this helps...
-Eric

Saturday, February 25, 2012

Can I use Forms Authentication with reporting services?

Hello, In my application I can configure if the user need to use forms or activde direcory, there may be customers that dont have active directory so Must make a login form, the question is how can I integrate forms authentication with reporting services?Yes, see the link below for a sample: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ufairs.asp

Thanks
Tudor