je to sice v c#, ale snad to nevadi, na netu jsou nejake prevodniky kodu.
private bool overeniExistenceTabulky(string nezevMeTab)
{
connStr = System.Configuration.ConfigurationManager.ConnectionStrings["MojeDB"].ConnectionString;
bool jevDB = false;
using (OleDbConnection myConnection = new OleDbConnection(connStr))
{
myConnection.Open();
using (OleDbCommand slelectCommand = new OleDbCommand("SELECT table_name FROM user_tables", myConnection))
{
using (OleDbDataReader myDataReader = slelectCommand.ExecuteReader())
{
while (myDataReader.Read())
{
if (nezevMeTab == myDataReader["table_name"].ToString()) jevDB = true;
}
}
}
}
return jevDB;
}
|