A
Art Levin
Hi Kevin,
Thanks for getting back to me.
I am using C# with asp.net to access the database.
Below is the code that I am using to access the two tables.
string DataBaseName;
string SelectCommand;
NameValueCollection coll;
coll = Request.ServerVariables;
DataBaseName = coll.Get("APPL_PHYSICAL_PATH");
DataBaseName += "Databases\\db.mdb";
OleDbConnection CustomerConnection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;"+
@"Data Source= " + DataBaseName);
OleDbCommand CustomerCommand = new OleDbCommand(
"SELECT * FROM Customers WHERE UserId = ?" ,CustomerConnection );
CustomerConnection.Open();
CustomerCommand.Parameters.Add("UserId",Session["UserId"].ToString());
CustomerReader = CustomerCommand.ExecuteReader(); CustomerReader.Read();
OleDbConnection StateConnection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;"+
@"Data Source= " + DataBaseName);
SelectCommand = "SELECT * FROM States";
StateCommand = new OleDbCommand(SelectCommand ,StateConnection );
StateConnection.Open(); StateReader = StateCommand.ExecuteReader();
while(StateReader.Read() == true)
Table 1 is still open when I access table 2.
If I only have 1 table opened at a time I don't seem to have any problems.
Here is what I get when I access the web site.
Server Error in '/' Application.
Could not use ''; file already in use.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Could not use ''; file
already in use.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[OleDbException (0x80004005): Could not use ''; file already in use.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
VeitchFulfillment.Fulfillment.AddressInformation.Init0() in
c:\inetpub\wwwroot\veitchfulfillment\fulfillment\addressinformation.aspx.cs:
230
VeitchFulfillment.Fulfillment.AddressInformation.OnInit(EventArgs e) in
c:\inetpub\wwwroot\veitchfulfillment\fulfillment\addressinformation.aspx.cs:
836
System.Web.UI.Control.InitRecursive(Control namingContainer) +241
System.Web.UI.Page.ProcessRequestMain() +174
I compared the setup of the database in windows explorer and in IIS with the
2000 machine. They seem to be identical.
Yes there is a .ldb file in the folder with the mdb
This is the only database I have at this time.
This is working fine on Windows 2000 Server with IIS 5.
It also works fine on my development machine. Windows XP Workstation.
Does this have anything to do with MSDE.
Does MSDE have to be installed manualy on the web server.
I hope you can help me.
Thank again.
Art Levin
Thanks for getting back to me.
I am using C# with asp.net to access the database.
Below is the code that I am using to access the two tables.
string DataBaseName;
string SelectCommand;
NameValueCollection coll;
coll = Request.ServerVariables;
DataBaseName = coll.Get("APPL_PHYSICAL_PATH");
DataBaseName += "Databases\\db.mdb";
OleDbConnection CustomerConnection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;"+
@"Data Source= " + DataBaseName);
OleDbCommand CustomerCommand = new OleDbCommand(
"SELECT * FROM Customers WHERE UserId = ?" ,CustomerConnection );
CustomerConnection.Open();
CustomerCommand.Parameters.Add("UserId",Session["UserId"].ToString());
CustomerReader = CustomerCommand.ExecuteReader(); CustomerReader.Read();
OleDbConnection StateConnection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;"+
@"Data Source= " + DataBaseName);
SelectCommand = "SELECT * FROM States";
StateCommand = new OleDbCommand(SelectCommand ,StateConnection );
StateConnection.Open(); StateReader = StateCommand.ExecuteReader();
while(StateReader.Read() == true)
Table 1 is still open when I access table 2.
If I only have 1 table opened at a time I don't seem to have any problems.
Here is what I get when I access the web site.
Server Error in '/' Application.
Could not use ''; file already in use.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Could not use ''; file
already in use.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[OleDbException (0x80004005): Could not use ''; file already in use.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
VeitchFulfillment.Fulfillment.AddressInformation.Init0() in
c:\inetpub\wwwroot\veitchfulfillment\fulfillment\addressinformation.aspx.cs:
230
VeitchFulfillment.Fulfillment.AddressInformation.OnInit(EventArgs e) in
c:\inetpub\wwwroot\veitchfulfillment\fulfillment\addressinformation.aspx.cs:
836
System.Web.UI.Control.InitRecursive(Control namingContainer) +241
System.Web.UI.Page.ProcessRequestMain() +174
I compared the setup of the database in windows explorer and in IIS with the
2000 machine. They seem to be identical.
Yes there is a .ldb file in the folder with the mdb
This is the only database I have at this time.
This is working fine on Windows 2000 Server with IIS 5.
It also works fine on my development machine. Windows XP Workstation.
Does this have anything to do with MSDE.
Does MSDE have to be installed manualy on the web server.
I hope you can help me.
Thank again.
Art Levin