Copyright 2008 Shoptalk Systems

SQLITECONNECT #handle, databaseName$

Description:

The SQLITECONNECT statement creates a new database or opens an existing database.  It returns a database accessor object and assigns it to the variable #records.  The simple act of connecting to a database that doesn't exist causes it to be created.

Example:

  sqliteconnect #records, "Records.db"
  query$ = "create table Payables (company char(50), invoice char(12), due integer, amt char(10))"
  #records execute(query$)
  #records disconnect()

If you need to test if a database exists you can use the FILES statement like so:

  files #accessor, "Records.db"
  exists = #accessor hasAnswer()
  if exists then print "the database file exists"

See also: SQLite for more details