Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database connection error!

Status
Not open for further replies.

z07924

IS-IT--Management
Feb 18, 2002
122
0
0
GB
Oops. The error: The Microsoft Jet database engine cannot open the file '\\Paragon\databases\Super_6\Test\ParaNet\sl_new.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

Even If nobody open the database also, I am getting the above error.

For this, I have changed processing model in machine.config file.

It is given below,

<processModel enable=&quot;true&quot; userName=&quot;Server\XUser&quot; password=&quot;Xpass&quot;/>

After changed the Processing model, It works fine.

But it is not a solution to do this.

If I want to move my application to development server, I am getting the same above error.

I cannot change machine.config file in the development server.

If anyone knows, How to solve this problem, let me know?.

I would really appreciate your help.

Thanks in Advance.


 
one problem that causes this error we have seen is that following a compact/repair event we have to &quot;copy&quot; the mdb; delete the original mdb, rename the copied mdb to the original, then it works just fine.

What does your connection string look like?
 
private void LoginBtn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string strDSN = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\\\Paragon\\databases\\Super_6\\Test\\ParaNet\\sl_new.mdb&quot;;

string strSQL = &quot;SELECT RepName, Password, Email FROM Passwords WHERE RepName ='&quot; + UserID.Text + &quot;'&quot;;

OleDbConnection myConn = new OleDbConnection(strDSN);
OleDbCommand myCmd = new OleDbCommand(strSQL, myConn);
OleDbDataReader dr = null;
try {
myConn.Open();
dr = myCmd.ExecuteReader();

if(dr.Read()) {

Session[&quot;gUserID&quot;] = dr.GetString(0);
Session[&quot;gEmailID&quot;] = dr.GetString(2);
if(dr.GetString(1).Trim() == password.Text)
{

FormsAuthentication.RedirectFromLoginPage(UserID.Text, false);
Message.Text = UserID.Text;
}
else
Message.Text = &quot;Sorry! Your login or password is incorrect. <br>Please log in again.&quot;;
}
else
{
Message.Text = &quot;Sorry! Your login or password is incorrect. <br>Please log in again.&quot;;
}
}
catch(Exception myException)
{

Message.Text = &quot;Oops. The error: &quot; + myException.Message;
Message.Text += &quot;<br>&quot; + strSQL;
}
finally
{
myConn.Close();
}
}

I didn't do any compact/repair database. I have posted my connection string here.
Let me know, If it is causing the problem.
I don't think the problem in the connection string. Any suggestion would be really appreciated.

Thanks in Advance.
 
You might try a variation on:

&quot;Provider=Microsoft.Jet.OLEDB.4.0; &quot;Data Source=&quot; & Server.MapPath(&quot;fpdb\Sites.mdb;&quot;))

...also, make sure your frontpage extensions are properly configured.
 
What is that for frontpage extensions?.

Instead of giving Server.MapPath(&quot;fpdb\Sites.mdb;&quot;), I gave direct path here.

Does it cause anything?.

Give me your suggestion..

Thanks in Advance.


 
I suppose the path is probably not critical --

Yes, when I installed IIS then Visual Studio I had to go through the control panel and set frontpage extensions for the web folder under Administrative Tools, then IIS.

Also, this is a common problem and Microsoft has posted material on &quot;none access&quot; rights to mdb files; might do a search there. Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top