mORMot and Open Source friends
Check-in [eaa62aaf89]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:added TOleDBJetConnectionProperties kind of connection to direct access of Microsoft Jet databases (.mdb files)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eaa62aaf89afd8a1bab18e703e717d940acf6ab0
User & Date: User 2012-06-10 13:31:48
Context
2012-06-10
13:54
fix unproper field creation for TOleDBJetConnectionProperties check-in: 07c0f6d6cb user: User tags: trunk
13:31
added TOleDBJetConnectionProperties kind of connection to direct access of Microsoft Jet databases (.mdb files) check-in: eaa62aaf89 user: User tags: trunk
2012-06-09
20:40
  • fix issue (depending on OleDB Provider) about ordinal binding error
  • fix retrieval of table and field metadata, for tables without schema (e.g. Jet/MSAccess database)
check-in: 32430cc1e7 user: User tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SQLite3/Samples/12 - SynDB Explorer/SynDBExplorer.dpr.

19
20
21
22
23
24
25



26
27
28
29
30
31
32
  - fix error ORA-00932 at OCI client level
  - added UTF-8 BOM to CSV or TXT exports
  - now direct-to-file fast export feature (into CSV, TXT, SQLite3,
    Synopse BigTable records or two JSON flavors)
  - now multi tables direct export into SQLite3 DB files (e.g. for support)
  - SQLite3 3.7.12.1 including (beta) private encryption methods




  first line of uses clause must be  {$I SynDprUses.inc}  to enable FastMM4
  conditional define should contain INCLUDE_FTS3 to handle FTS3/FTS4 in SQLite3 

*)

uses
  {$I SynDprUses.inc}






>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  - fix error ORA-00932 at OCI client level
  - added UTF-8 BOM to CSV or TXT exports
  - now direct-to-file fast export feature (into CSV, TXT, SQLite3,
    Synopse BigTable records or two JSON flavors)
  - now multi tables direct export into SQLite3 DB files (e.g. for support)
  - SQLite3 3.7.12.1 including (beta) private encryption methods

  Version 1.17
  - added Jet / MSAccess direct support (via OleDB provider)

  first line of uses clause must be  {$I SynDprUses.inc}  to enable FastMM4
  conditional define should contain INCLUDE_FTS3 to handle FTS3/FTS4 in SQLite3 

*)

uses
  {$I SynDprUses.inc}

Changes to SQLite3/Samples/12 - SynDB Explorer/SynDBExplorerClasses.pas.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
uses
  SysUtils, Classes,
  SynCommons, SQLite3Commons;

type
  TExpConnectionType = (
    ctOracleDirectOCI, ctOracleOLEDB, ctOracleMSOLEDB, ctMSSQL, ctGenericOLEDB,
    ctSqlite3);

  TSQLConnection = class(TSQLRecord)
  private
    fUserName: RawUTF8;
    fIdent: RawUTF8;
    fPassword: RawUTF8;
    fServer: RawUTF8;






|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
uses
  SysUtils, Classes,
  SynCommons, SQLite3Commons;

type
  TExpConnectionType = (
    ctOracleDirectOCI, ctOracleOLEDB, ctOracleMSOLEDB, ctMSSQL, ctGenericOLEDB,
    ctSqlite3, ctJet_mdbOLEDB);

  TSQLConnection = class(TSQLRecord)
  private
    fUserName: RawUTF8;
    fIdent: RawUTF8;
    fPassword: RawUTF8;
    fServer: RawUTF8;

Changes to SQLite3/Samples/12 - SynDB Explorer/SynDBExplorerMain.pas.

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
..
71
72
73
74
75
76
77
78

79
80
81
82
83
84
85
  
resourcestring
  sSelectAConnection = 'Select a connection';
  sNew = 'New connection';
  sNewOne = 'New';
  sConnectionHints = 'Display name|Database type|Server name '+
    '(for "Generic OLEDB", use ADO-like connection string, and ignore other fields; '+
    'for SQLite3, specify here the full file name)|'+
    'Database name (not needed for Oracle)|User login|'+
    'User password (set ? for prompt)';
  sSelectOrCreateAConnection = 'Select a connection to be used, or\n'+
    'click on "New connection" to create one.';
  sPleaseWaitN = 'Connecting to %s...';
  sUpdateConnection = 'Update connection settings';
  sPassPromptN = 'Please enter password for %s@%s:';

................................................................................

procedure TDbExplorerMain.FormCreate(Sender: TObject);
var Conns: TSQLRestServerStaticInMemory;
function TryConnect(C: TSQLConnection; LoadTableNames: boolean): boolean;
const CONN_CLASSES: array[TExpConnectionType] of TSQLDBConnectionPropertiesClass =
  (TSQLDBOracleConnectionProperties,TOleDBOracleConnectionProperties,
   TOleDBMSOracleConnectionProperties,TOleDBMSSQLConnectionProperties,
   TOleDBConnectionProperties,TSQLDBSQLite3ConnectionProperties);

var i: integer;
    Pass: RawUTF8;
begin
  result := false;
  try
    Pass := Crypt(C.Password);
    if Pass='?' then 






|
|







 







|
>







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
  
resourcestring
  sSelectAConnection = 'Select a connection';
  sNew = 'New connection';
  sNewOne = 'New';
  sConnectionHints = 'Display name|Database type|Server name '+
    '(for "Generic OLEDB", use ADO-like connection string, and ignore other fields; '+
    'for SQLite3 or Jet, specify the full file name)|'+
    'Database name (unneeded for Oracle/SQLite3/Jet)|User login|'+
    'User password (set ? for prompt)';
  sSelectOrCreateAConnection = 'Select a connection to be used, or\n'+
    'click on "New connection" to create one.';
  sPleaseWaitN = 'Connecting to %s...';
  sUpdateConnection = 'Update connection settings';
  sPassPromptN = 'Please enter password for %s@%s:';

................................................................................

procedure TDbExplorerMain.FormCreate(Sender: TObject);
var Conns: TSQLRestServerStaticInMemory;
function TryConnect(C: TSQLConnection; LoadTableNames: boolean): boolean;
const CONN_CLASSES: array[TExpConnectionType] of TSQLDBConnectionPropertiesClass =
  (TSQLDBOracleConnectionProperties,TOleDBOracleConnectionProperties,
   TOleDBMSOracleConnectionProperties,TOleDBMSSQLConnectionProperties,
   TOleDBConnectionProperties,TSQLDBSQLite3ConnectionProperties,
   TOleDBJetConnectionProperties);
var i: integer;
    Pass: RawUTF8;
begin
  result := false;
  try
    Pass := Crypt(C.Password);
    if Pass='?' then 

Changes to SynOleDB.pas.

72
73
74
75
76
77
78
79


80
81
82
83
84
85
86
...
606
607
608
609
610
611
612








613
614
615
616
617
618
619
....
2326
2327
2328
2329
2330
2331
2332









2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
  - add some reference to http://synopse.info/fossil/tktview?name=213544b2f5
    in case of wrong implementation of multi-thread connection (within the
    THttpServerGeneric mORMot server, for instance)

  Version 1.17
  - fix issue (depending on OleDB Provider) about ordinal binding error
  - fix retrieval of table and field metadata, for tables without schema
    (e.g. Jet/MSAccess database) 



}

{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER

interface

................................................................................

  /// OleDB connection properties to MySQL Server
  TOleDBMySQLConnectionProperties = class(TOleDBConnectionProperties)
  protected
    /// will set the appropriate provider name, i.e. 'MySQLProv'
    procedure SetInternalProperties; override;
  end;









  /// OleDB connection properties to IBM AS/400
  TOleDBAS400ConnectionProperties = class(TOleDBConnectionProperties)
  protected
    /// will set the appropriate provider name, i.e. 'IBMDA400.DataSource.1'
    procedure SetInternalProperties; override;
  end;
................................................................................
{ TOleDBAS400ConnectionProperties }

procedure TOleDBAS400ConnectionProperties.SetInternalProperties;
begin
  fProviderName := 'IBMDA400.DataSource.1';
  inherited SetInternalProperties;
end;










initialization
  assert(sizeof(TOleDBStatementParam)=sizeof(PTrUInt)*4+sizeof(Int64));

finalization
  {$ifndef DELPHI5OROLDER}
  if OleDBCoinitialized<>0 then
    SynDBLog.Add.Log(sllError,'Missing TOleDBConnection.Destroy call = %',
      OleDBCoInitialized);
  {$endif}
end.






|
>
>







 







>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>











72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
....
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
  - add some reference to http://synopse.info/fossil/tktview?name=213544b2f5
    in case of wrong implementation of multi-thread connection (within the
    THttpServerGeneric mORMot server, for instance)

  Version 1.17
  - fix issue (depending on OleDB Provider) about ordinal binding error
  - fix retrieval of table and field metadata, for tables without schema
    (e.g. Jet/MSAccess database)
  - added TOleDBJetConnectionProperties kind of connection to direct
    access of Microsoft Jet databases (.mdb files)

}

{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER

interface

................................................................................

  /// OleDB connection properties to MySQL Server
  TOleDBMySQLConnectionProperties = class(TOleDBConnectionProperties)
  protected
    /// will set the appropriate provider name, i.e. 'MySQLProv'
    procedure SetInternalProperties; override;
  end;

  /// OleDB connection properties to Jet/MSAccess .mdb files
  // - the server name should be the .mdb file name
  TOleDBJetConnectionProperties = class(TOleDBConnectionProperties)
  protected
    /// will set the appropriate provider name, i.e. 'Microsoft.Jet.OLEDB.4.0'
    procedure SetInternalProperties; override;
  end;

  /// OleDB connection properties to IBM AS/400
  TOleDBAS400ConnectionProperties = class(TOleDBConnectionProperties)
  protected
    /// will set the appropriate provider name, i.e. 'IBMDA400.DataSource.1'
    procedure SetInternalProperties; override;
  end;
................................................................................
{ TOleDBAS400ConnectionProperties }

procedure TOleDBAS400ConnectionProperties.SetInternalProperties;
begin
  fProviderName := 'IBMDA400.DataSource.1';
  inherited SetInternalProperties;
end;

{ TOleDBJetConnectionProperties }

procedure TOleDBJetConnectionProperties.SetInternalProperties;
begin
  fProviderName := 'Microsoft.Jet.OLEDB.4.0';
  inherited SetInternalProperties;
end;


initialization
  assert(sizeof(TOleDBStatementParam)=sizeof(PTrUInt)*4+sizeof(Int64));

finalization
  {$ifndef DELPHI5OROLDER}
  if OleDBCoinitialized<>0 then
    SynDBLog.Add.Log(sllError,'Missing TOleDBConnection.Destroy call = %',
      OleDBCoInitialized);
  {$endif}
end.