DB connect

This is the example code for 19.2.

[code]Var dbFile As FolderItem
dbFile = Folderitem.OpenFileDialog("")

If dbFile <> Nil Then
app.db = New SQLiteDatabase
app.db.DatabaseFile = dbFile
Try
app.db.Connect
MessageBox("Connected to " + dbFile.Name)
Catch error As DatabaseExeception
MessageBox("Error: " + error.Message)
End Try
End If[/code]

It gives 5 errors?

[code]MainWindow.ConnectDB, line 2
This item does not exist
dbFile = Folderitem.OpenFileDialog("")

MainWindow.ConnectDB, line 10
Can’t find a type with this name
Catch error As DatabaseExeception

MainWindow.ConnectDB, line 11
Parameter “message” expects type String, but this is type No Type.
MessageBox("Error: " + error.Message)

MainWindow.ConnectDB, line 10
Exception objects must be subclasses of RuntimeException
Catch error As DatabaseExeception

MainWindow.ConnectDB, line 10
There is no class with this name
Catch error As DatabaseExeception[/code]

Do I have to include somewhere that I want to use API2.0? Have I missed something?

Where was this example from?

Database.connect API2
http://documentation.xojo.com/api/deprecated/deprecated_class_members/database.connect.html_API2

Bad untested example with typos, try:

[code]Var dbFile As FolderItem
dbFile = FolderItem.ShowOpenFileDialog("")

If dbFile <> Nil Then
Var db As New SQLiteDatabase
db.DatabaseFile = dbFile
Try
db.Connect
MessageBox("Connected to " + dbFile.Name)
Catch Error As DatabaseException
MessageBox("Error: " + Error.Message)
End Try
End If[/code]

Works, thanks Julian