temporary work files showing up in getoldDbSchemaTable call

  • Thread starter Thread starter Brian O'Haire
  • Start date Start date
B

Brian O'Haire

Any help would be appreciated:

I have a routine on an asp.net web page, This code below point to a text
box called lbtable.

public void GetTables( )
{
//string [] TblDName = new string[255];
//string [] TblDType = new string[255];

try
{
this.Conn2 = new System.Data.OleDb.OleDbConnection();
this.Conn2.ConnectionString = curdbstring;
this.Conn2.Open();
tblNames = this.Conn2.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
new object[] {null, null, null, "TABLE"});
this.lbtable.DataSource = null;
this.lbtable.Items.Clear();
this.lbtable.DataSource= tblNames;
this.lbtable.DataTextField = "TABLE_NAME";
this.lbtable.DataBind();

}
catch (OleDbException ex)
{
Trace.Write(ex.Message);
}
finally
{
this.Conn2.Close();
}
return;
}

and most of the time it works correctly. However sometimes it show all the
correct tables and some tables up to 4 that start with ~TMPCLP. I
checked the access database and the files do not show up when viewing the
database in access(Access XP). When I refresh the screen, the bad files
still show, however I can not delete these files. If I shut everything down
and reboot, the bad files disappear and may not reappear for a few days.

Thanks in advance for your help

Sincerely
Brian O'Haire
 
Hi,

I guess it shows you temporary tables.
As a workaround you might use a DataView on result table and filter for
tables that don't start with ~.
Substring(table_name, 1, 1) <> "~" or something like that (I didn't test it
though).
 
Miha

Thanks for the suggestion. I agree that I am picking up the temporary files
however the part that concerned me was that I would check the database with
Access and they did not exist and then refresh the text box from the
database and get the same temporary files. Even though there was no reason
to have temporary files opened. I am the only user of the database. When I
repeated the same procedure sometimes they would show and sometimes they
would not.

Sincerely

Brian O'Haire MCSE MCDBA
and student trying to learn C# and asp.net
Miha Markic said:
Hi,

I guess it shows you temporary tables.
As a workaround you might use a DataView on result table and filter for
tables that don't start with ~.
Substring(table_name, 1, 1) <> "~" or something like that (I didn't test it
though).

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Brian O'Haire said:
Any help would be appreciated:

I have a routine on an asp.net web page, This code below point to a text
box called lbtable.

public void GetTables( )
{
//string [] TblDName = new string[255];
//string [] TblDType = new string[255];

try
{
this.Conn2 = new System.Data.OleDb.OleDbConnection();
this.Conn2.ConnectionString = curdbstring;
this.Conn2.Open();
tblNames = this.Conn2.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
new object[] {null, null, null, "TABLE"});
this.lbtable.DataSource = null;
this.lbtable.Items.Clear();
this.lbtable.DataSource= tblNames;
this.lbtable.DataTextField = "TABLE_NAME";
this.lbtable.DataBind();

}
catch (OleDbException ex)
{
Trace.Write(ex.Message);
}
finally
{
this.Conn2.Close();
}
return;
}

and most of the time it works correctly. However sometimes it show all the
correct tables and some tables up to 4 that start with ~TMPCLP. I
checked the access database and the files do not show up when viewing the
database in access(Access XP). When I refresh the screen, the bad files
still show, however I can not delete these files. If I shut everything down
and reboot, the bad files disappear and may not reappear for a few days.

Thanks in advance for your help

Sincerely
Brian O'Haire
 
Back
Top