Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2016, 09:05 AM
lexd lexd is offline
Senior Member
 
Join Date: Feb 2015
Posts: 268
Default Delphi 7 - MySql dbxopenmysql50

https://www.justsoftwaresolutions.co...d_mysql_5.html
Just software gives out free delphi dll code of the project dbxopenmysql50

One of the files SqlxApi.pas contains only some types of data
But MySQL 5.7 has moved on with more datatypes

I'm wanting to rebuild it with the new datatypes but do not have the info from Oracle to do so. Just software are more than happy for some one to continue the project.

does any one know where I could get such info as I can build the dll in Delphi 7 and test it.

HTML Code:
unit SqlxApi;

interface

uses {$IFNDEF LINUX} Windows, {$ELSE} libc, {$ENDIF}
  Classes, SysUtils, DBXpress, FMTBcd, SqlTimSt;

type
  INT16 = Smallint;
  UINT16 = Word;
  INT32 = Integer;
  UINT32 = LongWord;
  DFLOAT = double;

  PINT16 = ^INT16;
  PUINT16 = ^UINT16;
  PINT32 = ^INT32;
  PUINT32 = ^UINT32;
  PFLOAT = ^Single;
  PDFLOAT = ^DFLOAT;

  PSQLDATE = ^SQLDATE;
  PSQLTIME = ^SQLTIME;
  
type
{$IFDEF VER180}
  IDBXpressConnection = ISQLConnection25;
  IDBXpressCommand = ISQLCommand25;
  IDBXpressMetaData = ISQLMetaData25;
  IDBXpressCursor = ISQLCursor25;
  DBXpressFieldName = DBINAME32;
{$ELSE}
  IDBXpressConnection = ISQLConnection;
  IDBXpressCommand = ISQLCommand;
  IDBXpressMetaData = ISQLMetaData;
  IDBXpressCursor = ISQLCursor;
  DBXpressFieldName = DBINAME;
{$ENDIF}
  
const
  SQLX_TRUE = 1;
  SQLX_FALSE = 0;
  SQLX_ERROR = Word(-1);

  //ST SQL Trace
  ST_BASE = $1200;
  
  SQLX_NO_ERROR = 0;

  //DBX Common
  iST_SQL_UNKNOWN        = ST_BASE + 0;
  iST_SQL_QPREPARE       = ST_BASE + 1;
  iST_SQL_QEXECUTE       = ST_BASE + 2;
  iST_SQL_ERROR          = ST_BASE + 3;
  iST_SQL_STMT           = ST_BASE + 4;
  iST_SQL_CONNECT        = ST_BASE + 5;
  iST_SQL_TRANSACT       = ST_BASE + 6;
  iST_SQL_BLOB           = ST_BASE + 7;
  iST_SQL_MISC           = ST_BASE + 8;
  iST_SQL_VENDOR         = ST_BASE + 9;

  szST_SQL_UNKNOWN      = 'SQL UNKNOWN';
  szST_SQL_QPREPARE     = 'SQL Prepare';
  szST_SQL_QEXECUTE     = 'SQL Execute';
  szST_SQL_ERROR        = 'SQL Error';
  szST_SQL_STMT         = 'SQL Stmt';
  szST_SQL_CONNECT      = 'SQL Connect';
  szST_SQL_TRANSACT     = 'SQL Transact';
  szST_SQL_BLOB         = 'SQL Blob IO';
  szST_SQL_MISC         = 'SQL Misc';
  szST_SQL_VENDOR       = 'SQL Vendor';

const
  MAX_FORMAT_BUFFER_LENGTH = 50;
  MAX_PARAM_NAME_LENGTH = 64;
  MAX_HOST_NAME_LENGTH = 64;

type
  ///
  ///TParameter
  ///
  TByteArray = array of byte;
  
  TDBXParameter = packed record
    uParamNumber: UINT16;
    szName: array[0..MAX_PARAM_NAME_LENGTH] of Char;
    eParamType: TSTMTParamType;
    uPhyType: UINT16;
    uSubType: UINT16;
    lPrecision: INT32;
    lScale: INT32;
    data: TByteArray;
    ulLength: UINT32;
    iInd: WordBool;
  end;
  PDBXParameter = ^TDBXParameter;
  TDBXParameterArray = array of TDBXParameter;

  ///
  ///TDBXColumn
  ///
  TDBXColumn = packed record
    uColNum: UINT16;
    columnName: string;
    tableName: string;

    uLogType: UINT16;
    uLogSubType: UINT16;
    iLogPrecision: INT16;
    iLogScale: INT16;
    uLogLength: UINT32;

    uPhyType: UINT16;
    iPrecision: INT16;
    iScale: INT16;
    uFlags: UINT32;
    uOffset: UINT32;
    uLength: UINT32;
    uNullOffset: UINT32;
    uAttribute: UINT32;
  end;
  PDBXColumn = ^TDBXColumn;
  TDBXColumnArray = array of TDBXColumn;


  function _loadVendorLib(VendorLib: PChar): HMODULE;
  procedure _freeVendorLib(var hModule: HMODULE);
  function _getProcAddress(hModule: HMODULE; lpProcName: PChar): Pointer;
  procedure _strncpy(Source, Dest: PChar; Count: Integer);
  procedure _malloc(var Ptr: PChar; Size: Integer);
  procedure _free(var Ptr: PChar);

  //Parameter Function
  function _putParamBcd(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamBlob(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamBytes(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamDate(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamDouble(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamLong(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamShort(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamString(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamTime(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;
  function _putParamTimeStamp(pParam: PDBXParameter; pData: PByte; ulLength: UINT32): SQLResult;

implementation
uses Math,StrUtils;


end.
Reply With Quote
Reply

Tags
delphi, mysql

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 06:10 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.