|
Have you included Access itself as "any other application"?
what does that mean ? i am sorry
hello
|
|
|
|
|
Have you got "Microsoft Access" accessing the db while your application is running ?
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
no
"Microsoft Access" is closed while my application is running
hello
|
|
|
|
|
|
ghumman63 wrote: ""The Microsoft Jet database engine cannot open the file '\\software-11\Access\terminaldata.mdb'. It is already opened exclusively by another user, or you need permission to view its data. 12/14/2006 12:38:50 PM
""
i m getting this error when i access mdb file from my window service,,
i have accesss to that file ,, but in my service i get this exfeption
can any body help me ,, thanks in advance
There are two primary ways to open a connection to an MS Access database, first ‘shared’, second ‘exclusively’. If the database has been opened exclusively by someone else you will only be able to open a read only connection to it. Shared as implied allows for multiple connections to it.
Your post(s) seem to indicate nothing else has an open connection to the database.
What is your connection string?
Does your service have permission to the file share & *.mdb file its self?
MS Access also supports a primitive user roles schema. Have you modified the default “admin” role?
The bottom line here is the error message your seeing is the result of some type of permissions issue, be it at the file level or in the database it self.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
i am very new to extended stoared procedure.
i want it to use to send multiple records to sp at once
can any one Explain me what is the exact excution sequance of CLRSP
is this method useful for my task
Plz Help me.
Its urgent.
|
|
|
|
|
Hello,
I have created a backup of sql 2005, but when i go to restore that backup get the following error message below.
The way I have done my backup is full backup and overwrite existing backup. Everything else is at the default. This works ok.
When I restore I select the backup and under options overwrite existing database. Everything else is set to default.
Does anyone have any ideas about this.
Many thanks in advance,
Steve
TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore failed for Server 'DEV01'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)
|
|
|
|
|
I use a sql script which closes all connections to the database. Note this is in development so I don't really care about the impact to the connected applications.
print getdate()
GO
use master
declare @dbName nvarchar(1024)
SELECT @dbName = 'dbname'
declare @rowCount int
declare @spid int
SELECT @rowCount = 1
while (@rowCount > 0)
BEGIN
create table #temp
(
spid int,
ecid int,
status varchar(256),
loginname varchar(256),
hostname varchar(256),
blk int,
dbname varchar(256),
cmd varchar(256),
request_id int,
id int identity
)
insert into #temp
exec sp_who
SELECT TOP 1 * FROM #temp WHERE dbname = @dbName
SELECT top 1 @spid = spid
FROM #temp
WHERE dbname = @dbName
SELECT @rowCount = @@rowcount
if (@rowCount > 0)
exec('kill ' + @spid )
drop table #temp
END
RESTORE DATABASE [MedinaGold]
FROM DISK = N'backupFileLocation'
WITH FILE = 1,
MOVE N'data_name' TO N'c:\data\2005\cs\_Data.mdf',
MOVE N'log_name' TO N'c:\data\2005\cs\_Log.ldf',
NOUNLOAD, REPLACE, STATS = 10
GO
Just replace the database and file names with your values.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
Hello Chris,
Thanks for the script and I am sure it will come in handy. However, is there a simple way using server management studio?
Many thanks,
Steve
|
|
|
|
|
I haven't found one other then going into the list of active connections and closing them out from the list and then going back and running restore. The more you use SQL Server the more you end up doing through the query window anyway.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
|
Hi, I have difficulties about creating an Array of Object of type MySqlDataAdapter.
I used this syntax:
MySqlDataAdapter[] adtArrObj;
// my other codes here....
adtAddObj[0] = new MySqlDataAdapter(cmdObj);
I got error...
I've tried some other way, like:
MySqlDataAdapter[] adtArrObj = new MySqlDataAdapter()[];
error too..
any help? thx
|
|
|
|
|
MySqlDataAdapter[] adtArrObj = new MySqlDataAdapter[arraySize];
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
thx.
one more question, that Array of Adapter is static right? I mean it's size has been declared.
how to make that Array of Adapter dynamic?
I have 2 Forms, MainFormObj and ChildFormObj. ChildFormObj consist of dynamic array of MySqlDataAdapter.
So, when MainFormObj calls ChildFormObj, MainFormObj will generate the size (arraySize) of Array of DataAdapter in ChildFormObj.
thx again
|
|
|
|
|
In .net all arrays are static.
The dynamic array collections are the ArrayList in .net 1.x and 2.0.
In 2.0 the List<mysqldataadapter> is a generic strongly typed array type dynamic list.
Both of those use an add method rather then using an indexer to add to the array.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
|
I have a windows application in C# that I am trying to establish a remote connection to an SQL Server 2005 Express machine. I have tried to setup the sql express machine to accept remote connection using the MS SQL Server 2005 Configuration Tools, but it is still not working. When the run the app from my client pc with this connection string: "Server=\'machineName\\SQLEXPRESS\';Integrated Security=True;Connect Timeout=30;User Instance=True;database=\'PublicDB\';". I get this sql exception: Login failed for user ''. The user is not associated with a trusted SQL Server connection. Any help would be appreciated.
|
|
|
|
|
I suspect that you are using an account from your local system and not an account that exists on the SQL Server system. Both systems usually have to be in a domain using a domain account for a connection like that to work. Try enabling mixed authentication and using a sql server login.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
To add to Andy's reply: if you are in a workgroup rather than a domain, then the account used must be identical to one on the server machine, and must have an identical password in order for windows authentication to work.
|
|
|
|
|
Do either of you know of any tutorials that will show me how to do this properly?
|
|
|
|
|
Hello,
I have the following problem:
Let's say I have some small database with one table named "Activations" with two fields employeeID, date.
In order to add some row to the table I created stored procedure which looks like this:
<code>
CREATE PROCEDURE Activate
(
@employeeID int
)
AS
BEGIN TRANSACTION Activate
INSERT INTO Activations
(employeeID,date)
VALUES(@employeeID, GETDATE())
COMMIT TRANSACTION
</code>
In order to invoke this procedure I use the following code:
<code>
string connectionString = ConfigurationManager.ConnectionStrings["BazaConnection"].ConnectionString;
SqlConnection con = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand();
cmd.Parameters.Add(new SqlParameter("@employeeID", SqlDbType.Int, 4));
cmd.Parameters["@employeeID"].Value = 66; // some value
cmd.CommandText = "Activate";
cmd.CommandType = CommandType.StoredProcedure;
try
{
con.Open();
cmd.Connection = con;
int rowsAffected = cmd.ExecuteNonQuery();
Console.WriteLine("Rows affected: " + rowsAffected);
}
catch (Exception err)
{
Console.WriteLine(err.Message);
}
finally
{
con.Dispose();
con.Close();
}
</code>
After executing this code it says that 1 row has been affected but when
I browse contents of the Activations table there isn't any value. Everything
works fine when I execute stored procedure using Database Explorer in visual c# express edition.
Any idea what's wrong ?
I use sql server 2005 express edition
Thanks
--
Regards
tommy
|
|
|
|
|
The code looks good to me. You dont need to specify a length for sqldatatype int, but I don't know if this causes a problem in the proc. The only other thing i could think of is where you are looking for results in the db is not where the connection string is pointed to. Other than that I don't see anything wrong with it.
|
|
|
|
|
Hi,
yeah you got the point, the problem was with connection string.
In the beginning it was poiting to the file for example C:\baza.mdf
but when I added this file to my solution explorer, VC# simply copied it to my
project directory. Basically, I've been writing data to C:\baza.mdf but displaying them from file which has been in my project directory
thanks a lot!
tommy
|
|
|
|
|
Hello,
I am using VS 2005 (.NET 2.0) and MS-SQL 2005. I am trying to run a stored procedure from an ASP.NET application that uses a stored procedure that is passed a couple of parameters that are to be returned from the stored procedure, a return value from the procedure, and a recordset. The procedure will return the parameters and the returned value if I don't try and return the recordset, but as soon as I try to return the recordset the parameters and the return values don't get set?
The procedure does work fine inside the MS-SQL Server Manager. So the problem does not appear to be in the procedure. Is there something extra that needs to be setup in calling this kind of procedure?
Thanks,
Leo
Leo T. Smith
|
|
|
|
|
Leo - the return values/parameters do get set, but you have to read through the entire recordset before they get populated. This (apparently) is by design.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|