Home » Community » Newbie corner » EXCEPTION_ACCESS_VIOLATION (problem creating database in optimal mode)
EXCEPTION_ACCESS_VIOLATION [message #43274] |
Sat, 21 June 2014 12:45 |
idkfa46
Messages: 155 Registered: December 2011
|
Experienced Member |
|
|
hi guys,
I have a little problem with my databese...
When i compile in debug mode all is right but in optimal I have a crash with this kind of error:
Exception: C0000005 at 0057F5BA
EXCEPTION_ACCESS_VIOLATION
writing at 000000FB
All was working fine untill I decide to save my database in a subfolder /database 
String DatabasePath = "database/";
//Impostazioni database
bool nodb = false;
Sqlite3Session db;
db.LogErrors(true);
#ifdef flagDEBUG
db.SetTrace();
nodb = true;
#endif
// controlla la directory principale del programma
if(!DirectoryExists(DatabasePath)) DirectoryCreate(DatabasePath);
FileIn fi(DatabasePath + "database.db3");
if(fi.IsError() || fi.GetSize() <= 0)
nodb = true;
fi.Close();
if(!db.Open(DatabasePath + "database.db3"))
{
Exclamation(t_("Can't create or open database file"));
return;
}
SQL = db;
if(nodb)
{
SqlSchema sch(SQLITE3);
StdStatementExecutor se(db);
All_Tables(sch);
Progress p;
p.SetText(t_("Creating database tables"));
{
if(sch.ScriptChanged(SqlSchema::UPGRADE, DatabasePath))
{
Sqlite3PerformScript(sch.Upgrade(), se, p);
}
if(sch.ScriptChanged(SqlSchema::ATTRIBUTES, DatabasePath))
{
Sqlite3PerformScript(sch.Attributes(), se, p);
}
if(sch.ScriptChanged(SqlSchema::CONFIG, DatabasePath))
{
Sqlite3PerformScript(sch.ConfigDrop(), se, p);
Sqlite3PerformScript(sch.Config(), se, p);
}
sch.SaveNormal(DatabasePath);
}
}
Regards,
Matteo
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:51:14 CEST 2025
Total time taken to generate the page: 0.00467 seconds
|