Jump to content
Columbo

Help to find database error

Recommended Posts

Ok friends,

My son just loaned me one of his computers with Windows 10 on it so I downloaded and installed Delphi 11 Community on it.  I rewrote the code for the tutorial that I was trying in Delphi 7 with Delphi 11 and had 8 errors.  I corrected 7 of these errors and now I have just one left and I can’t see where the problem is.

When I run the program it connects to the database ok but when I click the ‘Execute’ button I get the error saying that ‘no such table: DAT2’.  I have attached an image of the database in SQLite Stuio showing the database and the tables.

I have obviously made an error in my code somewhere but I don’t see it.

Here is the code:


unit ConnectDB_u;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DbxSqlite, Data.FMTBcd, Data.DB,
  Data.SqlExpr, Vcl.StdCtrls, DBXpress, FMTBcd, DB, SqlExpr, StdCtrls,
  Classes, Controls;

type
  TfrmConnectDB = class(TForm)
    btnConnect: TButton;
    btnExecute: TButton;
    SQLConnection1: TSQLConnection;
    memOutput: TMemo;
    SQLQuery1: TSQLQuery;
    procedure btnConnectClick(Sender: TObject);
    procedure btnExecuteClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure ShowSelectResults();
  end;

var
  frmConnectDB: TfrmConnectDB;

implementation

{$R *.dfm}

procedure TfrmConnectDB.btnConnectClick(Sender: TObject);
begin
SQLConnection1.Params.Add('D:Delphi 11 Community\My Projects\Connecting to SQLite\Data\dat2.sqlite');
try
  //Establish the connection
  SQLConnection1.Connected := true;
  btnExecute.Enabled := true;
  memOutput.Text := 'Connection established';
  except
    on E: EDatabaseError do
    ShowMessage('Exception raised with message ' + E.Message);
  end;
 end;


procedure TfrmConnectDB.btnExecuteClick(Sender: TObject);
var
query: String;
begin
  memOutput.ClearSelection;
  //A random query
  query := 'SELECT * FROM DAT2;';
  try
  //Assign the query to the object SQLQuery1
  SQLQuery1.SQL.Text := query;
  SQLQuery1.Active := true;
  except
    on E: Exception do
    memOutput.Text := 'Exception raised with message:' + E.Message;
  end;
  //Show the results of the query in in a TMemo control
  ShowSelectResults();
  end;

procedure TfrmConnectDB.ShowSelectResults();
var
headline: TStringList;
i:integer;
currentField: TField;
currentLine: String;
begin
  if not SQLQuery1.IsEmpty then
  begin
    SQLQuery1.First;
    headline := TStringList.Create;
    try
      SQLQuery1.GetFieldNames(headline);
      while not SQLQuery1.Eof do
      begin
        currentLine := '';
        for i := 0 to headline.Count -1 do
        begin
          currentField := SQLQuery1.FieldByName(headline[i]);
          currentLine := currentLine + ' ' + currentField.AsString;
          end;
        memOutput.Lines.Add(currentLine);
        SQLQuery1.Next;
       end;
       finally
       headline.Free;
      end;
   end;
  end;
end.

 

Dat2.jpg

Share this post


Link to post

Open ConnectDB_u.dfm in Notepad, copy entire contents to the clipboard, and paste that in a reply to this post.

 

I am curious how SQLQuery1 is configured in the form designer. Another approach is to select SQLQuery1 in the form designer, press ctrl-c to copy just that component to the clipboard, and post it. But there could be other helpful details in the entire DFM, such as how SQLConnection1 is configured.

Share this post


Link to post
  while not SQLQuery1.Eof do
  begin
    currentLine := '';
	for i := 0 to sqlQuery1.fieldcount-1 do
  	  currentLine := currentLine + ' ' + sqlQuery1.fields[i].asString;
     memOutput.Lines.Add(currentLine);
     SQLQuery1.Next;
   end;

The above code doesn't require the Stringlist to iterate the fields of the query.

 

 

To add a database the documentation states it should be a form of (https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Using_SQLite_with_FireDAC):

 

Database=<path to SQLite database>

While you've tried: 

SQLConnection1.Params.Add('D:Delphi 11 Community\My Projects\Connecting to SQLite\Data\dat2.sqlite');

You should do

 

SQLConnection1.Params.Add('Database = ');  append here the real path to the database.

 

 

I believe instead of MemOutput.ClearSelection you wanted MemOutput.Clear.

Edited by Lajos Juhász
insert source into the post somehow deleted my post

Share this post


Link to post
11 hours ago, JonRobertson said:

Open ConnectDB_u.dfm in Notepad, copy entire contents to the clipboard, and paste that in a reply to this post.

 

I am curious how SQLQuery1 is configured in the form designer. Another approach is to select SQLQuery1 in the form designer, press ctrl-c to copy just that component to the clipboard, and post it. But there could be other helpful details in the entire DFM, such as how SQLConnection1 is configured.

Here is the contents of the ConnectDB_u.dfm:

 


object Form1: TForm1
  Left = 192
  Top = 107
  Width = 870
  Height = 450
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
end

Here is the code from SQLQuery1:

 


object SQLConnection1: TSQLConnection
  DriverName = 'Sqlite'
  Params.Strings = (
    'DriverUnit=Data.DbxSqlite'
    
      'DriverPackageLoader=TDBXSqliteDriverLoader,DBXSqliteDriver280.bp' +
      'l'
    
      'MetaDataPackageLoader=TDBXSqliteMetaDataCommandFactory,DbxSqlite' +
      'Driver280.bpl'
    'FailIfMissing=True'
    'Database=')
  Left = 304
  Top = 384
end

 

Edited by Columbo

Share this post


Link to post
9 hours ago, Lajos Juhász said:

  while not SQLQuery1.Eof do
  begin
    currentLine := '';
	for i := 0 to sqlQuery1.fieldcount-1 do
  	  currentLine := currentLine + ' ' + sqlQuery1.fields[i].asString;
     memOutput.Lines.Add(currentLine);
     SQLQuery1.Next;
   end;

The above code doesn't require the Stringlist to iterate the fields of the query.

 



I believe instead of MemOutput.ClearSelection you wanted MemOutput.Clear.

 

I am getting this code from an Embarcadero tutorial and that is what they use in the tutorial.

 

 

Share this post


Link to post
27 minutes ago, Columbo said:

Here is the contents of the ConnectDB_u.dfm:

That isn't the ConnectDB_u.dfm for the ConnectDB_u.pas that you posted above. The name of the form in that DFM is TForm1 and none of the components on your TfrmConnectDB form are in the DFM code you posted. It should look more like this:

 

object frmConnectDB: TfrmConnectDB
  Left = 0
  Top = 0
  Caption = 'frmConnectDB'
  ClientHeight = 442
  ClientWidth = 628
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -12
  Font.Name = 'Segoe UI'
  Font.Style = []
  TextHeight = 15
  object btnConnect: TButton
    Left = 280
    Top = 232
    Width = 75
    Height = 25
    Caption = 'btnConnect'
    TabOrder = 0
    OnClick = btnConnectClick
  end
  object btnExecute: TButton
    Left = 280
    Top = 312
    Width = 75
    Height = 25
    Caption = 'btnExecute'
    TabOrder = 1
    OnClick = btnExecuteClick
  end
  object memOutput: TMemo
    Left = 320
    Top = 56
    Width = 185
    Height = 89
    TabOrder = 2
  end
  object SQLConnection1: TSQLConnection
    DriverName = 'Sqlite'
    Params.Strings = (
      'DriverUnit=Data.DbxSqlite'
        'DriverPackageLoader=TDBXSqliteDriverLoader,DBXSqliteDriver280.bp' +
        'l'
        'MetaDataPackageLoader=TDBXSqliteMetaDataCommandFactory,DbxSqlite' +
        'Driver280.bpl'
      'FailIfMissing=True'
      'Database=')
    Left = 304
    Top = 384
  end
  object SQLQuery1: TSQLQuery
    Params = <>
    Left = 416
    Top = 296
  end
end

 

Share this post


Link to post
26 minutes ago, Columbo said:

I am getting this code from an Embarcadero tutorial and that is what they use in the tutorial.

Is that tutorial online? If so, please post a link.

Share this post


Link to post
1 hour ago, JonRobertson said:

Sorry, here it is:

		

		object frmConnectDB: TfrmConnectDB
		  Left = 0
		  Top = 0
		  Caption = 'Connect To Database'
		  ClientHeight = 442
		  ClientWidth = 628
		  Color = clBtnFace
		  Font.Charset = DEFAULT_CHARSET
		  Font.Color = clWindowText
		  Font.Height = -12
		  Font.Name = 'Segoe UI'
		  Font.Style = []
		  TextHeight = 15
		  object btnConnect: TButton
		    Left = 40
		    Top = 392
		    Width = 75
		    Height = 25
		    Caption = 'Connect'
		    TabOrder = 0
		    OnClick = btnConnectClick
		  end
		  object btnExecute: TButton
		    Left = 512
		    Top = 392
		    Width = 75
		    Height = 25
		    Caption = 'Execute'
		    TabOrder = 1
		    OnClick = btnExecuteClick
		  end
		  object memOutput: TMemo
		    Left = 8
		    Top = 56
		    Width = 612
		    Height = 321
		    TabOrder = 2
		  end
		  object SQLConnection1: TSQLConnection
		    DriverName = 'Sqlite'
		    Params.Strings = (
		      'DriverUnit=Data.DbxSqlite'
		      
		        'DriverPackageLoader=TDBXSqliteDriverLoader,DBXSqliteDriver280.bp' +
		        'l'
		      
		        'MetaDataPackageLoader=TDBXSqliteMetaDataCommandFactory,DbxSqlite' +
		        'Driver280.bpl'
		      'FailIfMissing=True'
		      'Database=')
		    Left = 304
		    Top = 384
		  end
		  object SQLQuery1: TSQLQuery
		    MaxBlobSize = -1
		    Params = <>
		    SQLConnection = SQLConnection1
		    Left = 304
		    Top = 304
		  end
		end		

		 		

		

 

Share this post


Link to post

Hum, looking at your dfm, I saw you use DBX components (hate those 😄). I was wondering why till I click on the link !

My suggestion still the same, use Firedac components 😉 

As samples, you can find some clues in C:\Users\Public\Documents\Embarcadero\Studio\22.0\Samples\Object Pascal\Database\FireDAC\Samples\Getting Started\SQLite and more 

Let me show you my version of your objective
unit1.dfm and .pas

object Form1: TForm1
  Left = 0
  Top = 0
  Width = 686
  Height = 501
  AutoScroll = True
  Caption = 'SQlite test'
  Color = clAqua
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -12
  Font.Name = 'Segoe UI'
  Font.Style = []
  OnCreate = FormCreate
  TextHeight = 15
  object DBGrid1: TDBGrid
    Left = 0
    Top = 0
    Width = 672
    Height = 177
    Align = alTop
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -12
    TitleFont.Name = 'Segoe UI'
    TitleFont.Style = []
  end
  object DBNavigator1: TDBNavigator
    Left = 0
    Top = 177
    Width = 672
    Height = 25
    DataSource = DataSource1
    Align = alTop
    TabOrder = 1
    ExplicitTop = 183
  end
  object Button1: TButton
    Left = 120
    Top = 208
    Width = 75
    Height = 25
    Caption = 'Button1'
    TabOrder = 2
    OnClick = Button1Click
  end
  object Memo1: TMemo
    Left = 0
    Top = 237
    Width = 672
    Height = 229
    Align = alBottom
    Lines.Strings = (
      'This will be fed via Button1 click')
    ScrollBars = ssVertical
    TabOrder = 3
  end
  object FDConnection1: TFDConnection
    Params.Strings = (
      
        'Database=C:\Users\Public\Documents\Embarcadero\Studio\22.0\Sampl' +
        'es\Data\fddemo.sdb'
      'LockingMode=Normal'
      'DriverID=SQLite')
    ConnectedStoredUsage = []
    Connected = True
    LoginPrompt = False
    Left = 288
    Top = 16
  end
  object FDTable1: TFDTable
    IndexFieldNames = 'CategoryID'
    Connection = FDConnection1
    ResourceOptions.AssignedValues = [rvEscapeExpand]
    TableName = 'Categories'
    Left = 176
    Top = 32
  end
  object DataSource1: TDataSource
    DataSet = FDTable1
    Left = 376
    Top = 48
  end
end
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls,
  Vcl.DBCtrls, Vcl.Grids, Vcl.DBGrids,
  Vcl.StdCtrls, Data.DB, FireDAC.Stan.Intf, FireDAC.Stan.Option,
  FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
  FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite,
  FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
  FireDAC.Phys.SQLiteWrapper.Stat, FireDAC.VCLUI.Wait, FireDAC.Stan.Param,
  FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.Comp.DataSet,
  FireDAC.Comp.Client
  ;

type
  TForm1 = class(TForm)
    FDConnection1: TFDConnection;
    DBGrid1: TDBGrid;
    DBNavigator1: TDBNavigator;
    Button1: TButton;
    Memo1: TMemo;
    FDTable1: TFDTable;
    DataSource1: TDataSource;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


uses StrUtils;

procedure TForm1.Button1Click(Sender: TObject);
var
  I: Integer;
  S : String;
begin
fdtable1.First;
memo1.Lines.Clear;
while not Fdtable1.EOF do
 begin
   memo1.Lines.Add('knowing fieldnames and type');
   memo1.Lines.Add(Format('%s %s %s',[fdtable1.FieldByName('CategoryID').asString,
                                      fdtable1.FieldByName('CategoryName').asString,
                                      fdtable1.FieldByName('Description').asString]));

   memo1.Lines.Add('using fielddefs');
   S:='';
   for I := 0 to FdTable1.FieldDefs.Count - 1 do
     begin
       if FDtable1.Fields[i].DataType=ftBlob // not readable data
         then S:=S+' (GRAPHIC)'
         else S:=S+Ifthen(I>0,' ','')+ // no separator for for first field
                   FDtable1.Fields[i].asString;
     end;
   Memo1.Lines.Add(S);
   fdtable1.Next;
 end;
fdtable1.First;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
fdtable1.Open();
end;

end.

Note. Table used contains only a few records so it is acceptable to use this sort of code, with huge one a thread should be considered, but, for a beginner it's a big piece :classic_smile:

Share this post


Link to post
8 hours ago, Serge_G said:

Hum, looking at your dfm, I saw you use DBX components (hate those 😄). I was wondering why till I click on the link !

My suggestion still the same, use Firedac components 😉 

 

Thanks Surge_G.  I'll look at your code and try to digest it.  I'll also read the documentation that you suggest in the link that you included.  But, in my code I am only getting one error and that is that it says that there is 'no such table DAT2.  If you look at the image that I attached in my message at the top of this page you can see that the table does exist so I am guessing that maybe I have some kind of error in my code.

 

Share this post


Link to post
On 11/30/2023 at 8:32 PM, Columbo said:

SQLConnection1.Params.Add('D:Delphi 11 Community\My Projects\Connecting to SQLite\Data\dat2.sqlite');

You have a connection path with spaces, are you shure the db component can handle spaces? Not all do.

Share this post


Link to post
2 minutes ago, Hans J. Ellingsgaard said:

You have a connection path with spaces, are you shure the db component can handle spaces? Not all do.

When I run the program it says 'Connection established'.  The error comes when it tries to retrieve data from the table DAT2.  The error says 'no such table.'

 

Share this post


Link to post
5 hours ago, Columbo said:

When I run the program it says 'Connection established'.  The error comes when it tries to retrieve data from the table DAT2.  The error says 'no such table.'

 

That should mean it is Ok with spaces in the path, but AFAIK SQLite is a file based db, not a RDBMS, so just to be 100% safe, I would try to place the db file in a path without spaces.

Share this post


Link to post
Quote

'D:Delphi 11 Community\My Projects\Connecting to SQLite\Data\dat2.sqlite'

...there is a \ missing. "D:\Delphi..." 😎

Share this post


Link to post
12 hours ago, haentschman said:

...there is a \ missing. "D:\Delphi..." 😎

Thanks,  I corrected that.  I still don't understand why it says that there is 'no such table DAT2' when clearly it is there.

Share this post


Link to post

Well, I rewrote the entire tutorial but this time I used FireDAC components for the connection and query.  When I run the program it says 'Connection established!'.  Then when I click the 'Execute' button I get the same error as with the Delphi components saying 'no such table DAT2'.  If you look at the image in my post at the top of this page you can see that the table DAT2 clearly exists.  I'm totally confused with this.  Suggestions?

 


t FDTest_u;

interface

uses

  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,

  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option,

  FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,

  FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.VCLUI.Wait,

  FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB,

  FireDAC.Comp.DataSet, FireDAC.Comp.Client, Vcl.StdCtrls, FireDAC.Phys.SQLite,

  FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,

  FireDAC.Phys.SQLiteWrapper.Stat;

type

  TfrmDatabaseTest = class(TForm)

    FDConnection1: TFDConnection;

    btnConnect: TButton;

    btnExecute: TButton;

    memData: TMemo;

    FDQuery1: TFDQuery;

    procedure btnConnectClick(Sender: TObject);

    procedure btnExecuteClick(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  procedure ShowSelectResults;

  end;

var

  frmDatabaseTest: TfrmDatabaseTest;

implementation

{$R *.dfm}

procedure TfrmDatabaseTest.btnConnectClick(Sender: TObject);

begin

FDConnection1.Params.Add('D:\Database=Delphi 11 Community\My Projects\FDTest\Data\dat2.sqlite');

  try

    //Establish connection

    FDConnection1.Connected := true;

    btnExecute.Enabled := true;

    memData.Text := 'Connection established!';

    except

      on E: EDatabaseError do

        ShowMessage('Exception raised with message:' + ' ' + E.Message);

      end;

  end;

procedure TfrmDatabaseTest.btnExecuteClick(Sender: TObject);

var

query: String;

begin

 memData.ClearSelection;

 //A random query

 query := 'SELECT * FROM DAT2;';

 try

   //Assign the query to the object FDQuery1

   FDQuery1.SQL.Text := query;

   FDQuery1.Active := true;

   except

     on E: Exception do

       memData.Text := 'Exception raised with message: ' + ' ' + E.Message;

      end;

      //Show the results of the query in a TMemo control

      ShowSelectResults();

   end;

 procedure TfrmDatabaseTest.ShowSelectResults();

 var

 headline: TStringList;

 i: integer;

 currentField: Tfield;

 currentLine: String;

 begin

  if not FDQuery1.IsEmpty then

  begin

    FDQuery1.First;

    headline := TStringList.Create;

    try

      FDQuery1.GetFieldNames(headline);

      while not FDQuery1.Eof do

      begin

        currentline := '';

        for i := 0 to headline.Count-1 do

        begin

          currentField := FDQuery1.FieldByName(headline[i]);

          currentLine := currentLine + ' ' + currentField.AsString;

        end;

        end;

       memData.Lines.Add(currentLine);

    FDQuery1.Next;

 finally

  headline.Free;

    end;
  end;
end;

end.

Edited by Columbo

Share this post


Link to post

Do you happen to have leading characters in the table title?

Share this post


Link to post

Hi...😎

 

The Query needs the connection. Via ObjectInspector or via code. Check this...😉

FDQuery1.Connection := FDConnection1; // or via ObjectInspector

FDQuery1.SQL.Text := query;
FDQuery1.Open; // better

image.png.1615a892dfe200bb6266fccaa9acb495.png

Share this post


Link to post
'D:\Database=Delphi 11 Community\My Projects\FDTest\Data\dat2.sqlite'

Problem is here. I don't think path is correct. First this = is somehow perturbing me, and those white spaces 🙄 don't help 

image.png.6e87a9cf81b7b759e7ae9d99b72e5c5a.png

I suspect you use part of the info here but, don't use 'Database' just the database file path 

 

 

Then I am not sure your database is disconnected when you run  program (set option  ActiveStoredUsage to [] or only [auDesignTime]

 

as @haentschman simplify your code, code can be only

FDquery1.Open(query);

or

FDquery1.Open('Select * from DAT2'); 

And last but not least, you will be confronted with a "locking" problem if you don't set connexion option LockingMode to Normal
 

 

Share this post


Link to post
FDquery1.Open(query);
//or
FDquery1.Open('Select * from DAT2'); 

...What about queries with parameters...then that doesn't work.  :classic_cool: 2 notations with or without parameters...no.  :classic_tongue:

Share this post


Link to post

You can add parameters , just adding an array

FDQuery1.Open('SELECT * FROM DAT2 WHERE <Column>=:V',[<aValue>]);

easy, and quick, no need to close FDQuery1

Share this post


Link to post

First of all, I want to thank everyone for their help and suggestions.

 

I'll try to respond to all of the suggestions in this one post.

 

Stano:  No leading spaces in table title.

 

haentschman: 

Quote

The Query needs the connection. Via ObjectInspector or via code.

 

I have it set in the Inspector  'Connection  FDConnection1'

 

Serge_G:  I Changed the folder names removing all of the white spaces and changed the path in my code to reflect that.  As for adding parameters, I am aware of that but if it can't find the table 'DAT2' I don't think the parameters mean much.  I removed 'Database = ' and I set ActiveStorageUsage to [auDesignTime].

 

I am still getting ''no such table DAT2'.  When I click the 'Connect' button it says  'Connection established!'  but how can I tell if there really is a connection to the database?

 

Edited by Columbo

Share this post


Link to post
1 hour ago, Columbo said:

but how can I tell if there really is a connection to the database

The easy way to test anything in programming is to intentionally break code. For example, in your SQLite project, change Database= to a file that you know does not exist. When I did that, I got a dialog saying "unable to open database file."

 

Using the link you provided, I did that tutorial with the Employee.s3db database in Embarcadero's samples folder, and it worked as expected. And if I change the query to SELECT * from dat2, I get the same error you are (as I would expect with this database).

 

Attached is my version of the tutorial project. Object names don't match the tutorial and I added output when no rows are returned. It attaches to a database named dat2.db in the same folder as the project.

 

The screenshot you posted of the database & table did not have "data type" for each column. Are you sure you have completely created *and* saved the database? I used DB Browser for SQLite and there is a button to "Write Changes".

 

My best guess is the database file that your Delphi project is opening does not have a table named dat2.

Tutorial.zip

Share this post


Link to post

Hi JonRobertson,  In the tutorial I changed the database from employees to the database that I was going to use in the program that I want to write, that is if I can figure this Delphi tutorial out.  The database is dat2.sqlite and the table is DAT2.  I originally wrote the program in Clipper back in 1997 and the database was in .DBF format.  I later converted the .DBF to SQLite and then I wrote the same program again in Purebasic using the sqlite format of the Database and it worked perfectly.  The file that I am trying to access with FireDAC is the same database that I used in the Purebasc version of the program.  The table is definitely there and it is DAT2.

 

I followed you suggestion and changed the database from dat2.sqlite in the path to dummy.sqlite and it still says 'Connection established!' so that may be where the problem lies.  It is probably not opening the database and thus cannot find the table.  So I guess I have to determine if it is not opening the database, then why?

 

I'll look at your tutorial although I suspect that the only real difference will be the database and table names.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×