You are confusing between Basic4ppc language and SQL language.
The way to work with SQL queries is to build a string that holds the query and then pass this string to a SQL Command object.
The first steps that are required when working with the SQL library are:
- Add a reference to SQLDesktop.dll and SQLDevice.dll.
- Add a Connection object and a Command object.
This is the code that builds your table (the program is attached):
Code:
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
connection.New1
connection.Open("Data Source = " & AppPath & "\myDb.db")
command.New1("",connection.Value)
CreateTable
'Show the table
command.CommandText = "SELECT * FROM ScanData"
command.ExecuteTable("table1",0)
form1.Show
End Sub
Sub CreateTable
command.CommandText = _
"CREATE TABLE IF NOT EXISTS ScanData " & _
"( Nummer Int Not NULL UNIQUE, " & _
"EAN varchar(13) UNIQUE, " & _
"Name varchar(30), " & _
"Groesse Real, " & _
"Einheit varchar(4), " & _
"Bisher Int, " & _
"Menge Int " & _
")"
command.ExecuteNonQuery
End Sub