SQL Test app
Posted: Tue Nov 21, 2023 1:03 pm
Trying to set up a basic SQL test app. Using SQLite3 ODBC. Here is the code and the compile errors. Thanks in advance for any help.
VO Dialect has been selected.
Here are the errors:
System
System.Core
XSharp.Core
XSharp.RT
XSharp.SQLClasses
(I've tried to attach the project and test DB but I get a message saying "invalid extension" when I select the .viaef and the .db file.)
Thank you again. I once started a project to convert from DBF to the VO SQL classes using SQLite ODBC and ran into some difficulties converting all the app features, so I abandoned the project, But most of the app worked in VO. I tried exporting it to X# and it did compile with no errors. But the app didn't work (windows just disappeared when I tried to open them) so I've decided to start over using only what's available in X#.
If I'm taking the wrong approach, please advise. The reason I'm using SQLite is simple: No server. Nothing for the user to install. Cuts down on support time.
Goal is to have the same database with different "front-ends" in Windows and in a browser. So both Windows and web users will be happy.
VO Dialect has been selected.
Code: Select all
FUNCTION Start( ) AS VOID
LOCAL cDB AS STRING
LOCAL oConnection AS SQLConnection
LOCAL oStatement AS SQLStatement
LOCAL cStatement AS STRING
* trying to open an SQLite3 database
* here is the ODBC driver:
* http://www.ch-werner.de/sqliteodbc/
cDB := "c:\fr\FPTEST.DB" // used the attached sample db
SQLConnectErrorMsg( TRUE )
oConnection := SQLConnection{"SQLite3", "", "" }
oConnection:connect()
cStatement := "ATTACH DATABASE " + cDB + " AS JoeDb"
oStatement := SQLStatement{cStatement , oConnection }
IF !oStatement:Execute()
System.Console.WriteLine("Did not connect")
ENDIF
RETURN
Here are the errors:
Here are the references:error XS0246: The type or namespace name 'SQLConnection' could not be found (are you missing a using directive or an assembly reference?) 3,2 Start.prg Start
error XS0246: The type or namespace name 'SQLStatement' could not be found (are you missing a using directive or an assembly reference?) 4,2 Start.prg Start
error XS0012: The type 'SQLConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'JoeSQLTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 14,2 Start.prg Start
error XS0246: The type or namespace name 'SQLConnection' could not be found (are you missing a using directive or an assembly reference?) 14,17 Start.prg Start
error XS0012: The type 'SQLConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'JoeSQLTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 15,2 Start.prg Start
error XS0012: The type 'SQLStatement' is defined in an assembly that is not referenced. You must add a reference to assembly 'JoeSQLTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 18,3 Start.prg Start
error XS0246: The type or namespace name 'SQLStatement' could not be found (are you missing a using directive or an assembly reference?) 18,17 Start.prg Start
error XS0012: The type 'SQLConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'JoeSQLTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 18,43 Start.prg Start
error XS0012: The type 'SQLStatement' is defined in an assembly that is not referenced. You must add a reference to assembly 'JoeSQLTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 19,7 Start.prg Start
warning XS0168: The variable 'oConnection' is declared but never used 3,2 Start.prg Start
warning XS0168: The variable 'oStatement' is declared but never used 4,2 Start.prg Start
Compilation failed (9 errors, 2 warnings)
System
System.Core
XSharp.Core
XSharp.RT
XSharp.SQLClasses
(I've tried to attach the project and test DB but I get a message saying "invalid extension" when I select the .viaef and the .db file.)
Thank you again. I once started a project to convert from DBF to the VO SQL classes using SQLite ODBC and ran into some difficulties converting all the app features, so I abandoned the project, But most of the app worked in VO. I tried exporting it to X# and it did compile with no errors. But the app didn't work (windows just disappeared when I tried to open them) so I've decided to start over using only what's available in X#.
If I'm taking the wrong approach, please advise. The reason I'm using SQLite is simple: No server. Nothing for the user to install. Cuts down on support time.
Goal is to have the same database with different "front-ends" in Windows and in a browser. So both Windows and web users will be happy.