My app was working fine since the last update in September. Recently a windows update (1709) causes my app to crash ‘all the time’. It’s a hard crash, no exception to be handled. I commented out all my declares to make sure I have only Xojo code. Currently running the app in compatibility mode for windows makes the app usable although it still crashes occasionally. I tried compiling the app with 2015r3.1 and it doesn’t crash. However going back to 2015r3.1 will require a lot of other work so I hope I don’t need to do that. Any suggestions where to look?
Understandably my customers are very concerned and upset. They don’t like to type in an entire order and have a crash before they save it.
Try to run dbgview (a free utility from the Microsoft Sysinternals suite). Run dbgview first, then launch your application and make it crash. Right away, dbgview should have information on what failed. It could be that a library was either removed or moved to a location that your application does not expect, or perhaps something completely different.
Here are the only places I write to a SQLite file. Can’t see how it could possibly be ‘my fault’.
Function Setting(Name as string) As DatabaseField
pSQLps = MainDB.Prepare("Select * From Settings where Name like $1")
dim rs as RecordSet = pSQLps.SQLSelect(Name)
if MainDB.Error then MsgBoxT MainDB.ErrorMessage
if rs <>nil and rs.RecordCount > 0 then
return rs.Field("Value")
else
pSQLps = MainDB.Prepare("INSERT INTO Settings (Name, Value) VALUES ($1,$2)")
pSQLps.SQLExecute(Name,"")
pSQLps = MainDB.Prepare("Select * From Settings where Name like $1")
rs = SQLps.SQLSelect(Name)
if MainDB.Error then MsgBoxT MainDB.ErrorMessage
if rs <> nil and rs.RecordCount > 0 then
return rs.Field("Value")
else
MsgBoxT "I don't know what is wrong! Problem in Settings module."
end if
end if
End Function
[code]Sub Setting(Name as string, Assigns Value as Variant)
pSQLps = MainDB.Prepare(“Select * From Settings where Name like $1”)
dim rs as RecordSet = pSQLps.SQLSelect(Name)
if MainDB.Error then MsgBoxT MainDB.ErrorMessage
if rs = nil or rs.RecordCount = 0 then
'if setting is not in table add it
pSQLps = MainDB.Prepare(“INSERT INTO Settings (Name, Value) VALUES ($1,$2)”)
pSQLps.SQLExecute(Name,Value)
if MainDB.Error then MsgBoxT MainDB.ErrorMessage
Else
'otherwise update it
pSQLps = MainDB.Prepare(“UPDATE Settings SET Value = $1 where Name = $2”)
pSQLps.SQLExecute(Value.StringValue,Name)
if MainDB.Error then MsgBoxT MainDB.ErrorMessage
end if
End Sub
[/code]
[code]Public Sub Setting(Name as string, Assigns Value as Variant)
SQLps = SettingsDB.Prepare(“Select * From Settings where Name like ?”)
SQLps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
dim rs as RecordSet = SQLps.SQLSelect(Name)
SettingsDB.ShutDownIfIOError
if SettingsDB.Error then MsgBoxT SettingsDB.ErrorMessage
if rs = nil or rs.RecordCount = 0 then
'if setting is not in table add it
SQLps = SettingsDB.Prepare(“INSERT INTO Settings (Name, Value) VALUES (?,?)”)
SQLps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
SQLps.BindType(1, SQLitePreparedStatement.SQLITE_TEXT)
SQLps.SQLExecute(Name,Value.StringValue)
if SettingsDB.Error then MsgBoxT SettingsDB.ErrorMessage
Else
'otherwise update it
SQLps = SettingsDB.Prepare(“UPDATE Settings SET Value = ? where Name = ?”)
SQLps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
SQLps.BindType(1, SQLitePreparedStatement.SQLITE_TEXT)
SQLps.SQLExecute(Value.StringValue,Name)
if SettingsDB.Error then MsgBoxT SettingsDB.ErrorMessage
end if
End Sub
[/code]
Public Function Setting(Name as string) as DatabaseField
SQLps = SettingsDB.Prepare("Select * From Settings where Name like ?")
SQLps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
dim rs as RecordSet = SQLps.SQLSelect(Name)
SettingsDB.ShutDownIfIOError
if SettingsDB.Error then MsgBoxT SettingsDB.ErrorMessage
if rs <>nil and rs.RecordCount > 0 then
return rs.Field("Value")
else
SQLps = SettingsDB.Prepare("INSERT INTO Settings (Name, Value) VALUES (?,?)")
SQLps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
SQLps.BindType(1, SQLitePreparedStatement.SQLITE_TEXT)
SQLps.SQLExecute(Name,"")
SQLps = SettingsDB.Prepare("Select * From Settings where Name like ?")
SQLps.BindType(0, SQLitePreparedStatement.SQLITE_TEXT)
rs = SQLps.SQLSelect(Name)
if SettingsDB.Error then MsgBoxT SettingsDB.ErrorMessage
if rs <> nil and rs.RecordCount > 0 then
return rs.Field("Value")
else
MsgBoxT "I don't know what is wrong! Problem in Settings module."
end if
end if
End Function
Opps read your question wrong, and thought you meant the sqlitedatabse.dll. The sqlite database is in a subfolder in the same folder as the app. And I can read and write just fine. It’s the crashes that are the problem.