I trying to compile statically into my program the driver. I have Add DbxOpenOdbc and add .\dbxoodbc_version_3_100_at_2008-03-24\Source in the search path.
When I compile my application I see that is compiling the driver.
But it will not stop in to my break point. I don't see any blue point(compile point) in the left side of the code except in the Initialization and Finalization.
I'm using driver version 3.100 2008-24 into Delphi2007
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In Delphi 2007 such possibilities not mortgaged. This I have did more for itself. But can appear the problem with termination of exhibit. The Decision this below:
In the function "TCustomSQLDataSet.GetFieldData" from SQLexpr.pas it is setting the FFieldBuffer length to 11 but I have some parameter name that have 11 charactere.
When he is getting the Ansistring It is looking for the next "/0" end string, and it overpass memory.
For Exemple let say that I have 3 parameters : IO_NAME, IO_PROGDESC, IO_ERROR
In your driver I see it OK those tree parameter but in SQLexpr It's gaving me
where ? is garbage
Parameter 1 = I O _ N A M E /0 ? ? ? return IO_NAME
Parameter 2 = I O _ P R O G D E S C return IO_PROGNAME??? will go to the next /0 char in memory
Parameter 3 = I O _ E R R O R /0 ? ?
Where Came from the Length in this ligne?
Column.Size := Length;
in this constructor
constructor TDBXDynalinkReader.Create(DBXContext: TDBXContext;
Can it be add by 1 to make sure that /0 is at the end?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have had a option in TConnectionOptions (coSysNaming) default to "osoff"
when driver is eOdbcDriverTypeIbmDb2AS400 turn it to "osOn"
In procedure TSqlCursorMetaDataProcedureParams.FetchProcedureParams;
add a internal procedure
SysNamingSchema : String;
//Added by Sebastien to remove duplicated parameter
function RetrieveProcedureSchemaForSysNaming(pProcName : PAnsiCHAR) : String;
var
Len: LongWord;
Cursor: ISQLCursor25;
aStoredProcSchema: string;
IsBlank: LongBool;
aResult: SQLResult;
begin
aResult := self.fOwnerMetaData.getProcedures(pProcName,0,Cursor);
if aResult = SQL_SUCCESS then begin
Cursor.getColumnLength(3,Len);
SetLength(aStoredProcSchema,Len+1);
aResult := Cursor.next;
if aResult = SQL_SUCCESS then begin
Cursor.getString(3, PAnsiChar(aStoredProcSchema), IsBlank);
result := aStoredProcSchema;
end;
end;
end;
begin
if (fSqlConnectionOdbc.fConnectionOptions[coSysNaming] = osOn) then
begin
SysNamingSchema := RetrieveProcedureSchemaForSysNaming(SearchProcedureName);
OdbcRetcode := SQLProcedureColumns(fHStmt,
fMetaCatalogName, SQL_NTS, // Catalog name
pAnsiChar(SysNamingSchema), SQL_NTS, // Schema name
fMetaTableName, SQL_NTS, // Procedure name match pattern
SearchParamName, SQL_NTS); // Column name match pattern
end
else
begin
OdbcRetcode := SQLProcedureColumns(fHStmt,
fMetaCatalogName, SQL_NTS, // Catalog name
fMetaSchemaName, SQL_NTS, // Schema name
fMetaTableName, SQL_NTS, // Procedure name match pattern
SearchParamName, SQL_NTS); // Column name match pattern
end;
if OdbcRetcode <> OdbcApi.SQL_SUCCESS then
OdbcCheck(OdbcRetcode, 'SQLProcedureColumns');
Thanks is the modification that I have done for Iseries driver for naming convention "sysnaming"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have installed D2007 with your driver version 3.100 and I receive "dbExpress Version 2.5 not supported yet"
I have compile version D11 make sure it use this DLL and still same error.
Do you have a Idea
Signifies you have untrue indicated the parameters of the connection. See the examples.
dbx 2.5 down:
dbxconnections.ini
dbxdrivers.ini
dbx 3:
dbx3-drivers.ini
dbx3-connections.ini
odbc unicode
GetDriverFunc=getSQLDriverODBCW
odbc ansi
GetDriverFunc=getSQLDriverODBCWA
example : mssql 2005:
object SQLConnection1: TSQLConnection
DriverName = 'Db3SQLServer'
GetDriverFunc = 'getSQLDriverODBCW'
LibraryName = 'dbxoodbc.dll'
LoginPrompt = False
Params.Strings = (
'DATABASE=DRIVER=SQL Server;SERVER=127.0.0.1\SQLEXPRESS2005;Trust' +
'ed_Connection=Yes;coCatPrefix=DATABASE')
VendorLib = 'sqlncli.dll'
Left = 52
Top = 128
end
example : mssql 2000:
object SQLConnection1: TSQLConnection
DriverName = 'DbxSQLServerW'
GetDriverFunc = 'getSQLDriverODBCW'
LibraryName = 'dbxoodbc.dll'
LoginPrompt = False
Params.Strings = (
'DbxSQLServer TransIsolation=ReadCommited'
'Database=?'
'User_Name='
'Password='
'RowsetSize=20'
'BlobSize=-1'
'Trim Char=True'
'Custom String=coConnectionString=DATABASE=dbxoodbc;Trusted_Conne' +
'ction=Yes;SERVER=127.0.0.1;coLockMode=17;coCatPrefix=DATABASE'
'Prepare SQL=False')
VendorLib = 'sqlsrv32.dll'
Left = 56
Top = 64
end
and see
https://sourceforge.net/forum/forum.php?thread_id=1966856&forum_id=119359
OK Thanks for this points It Working
But still having probleme with CWBODBC.dll Iseries vendor.
Do you know this one with DELPHI 2007
I have no db2. Additionally you do not describe your problem detailed. Describe the parameters of the connection and errors...
Hello Vadim,
I trying to compile statically into my program the driver. I have Add DbxOpenOdbc and add .\dbxoodbc_version_3_100_at_2008-03-24\Source in the search path.
When I compile my application I see that is compiling the driver.
But it will not stop in to my break point. I don't see any blue point(compile point) in the left side of the code except in the Initialization and Finalization.
I'm using driver version 3.100 2008-24 into Delphi2007
uses ..., DbxOpenOdbcStatic;
In Delphi 2007 such possibilities not mortgaged. This I have did more for itself. But can appear the problem with termination of exhibit. The Decision this below:
procedure HaltEx(uExitCode: Integer = 0);
begin
TerminateProcess(OpenProcess(PROCESS_TERMINATE, False, GetCurrentProcessID()), uExitCode);
end;
procedure TFormMain.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
//close resources
SqlConnection1.Close;
// quick close application (all memory will be freed by os)
{$IFNDEF _CHECK_MEMORY_LEAKS_}
HaltEx(0);
{$ENDIF}
end;
The Latest version is: '3.100 (2008-05-12)'
Hi M. Vadim,
I have a other issus.
In the function "TCustomSQLDataSet.GetFieldData" from SQLexpr.pas it is setting the FFieldBuffer length to 11 but I have some parameter name that have 11 charactere.
When he is getting the Ansistring It is looking for the next "/0" end string, and it overpass memory.
For Exemple let say that I have 3 parameters : IO_NAME, IO_PROGDESC, IO_ERROR
In your driver I see it OK those tree parameter but in SQLexpr It's gaving me
where ? is garbage
Parameter 1 = I O _ N A M E /0 ? ? ? return IO_NAME
Parameter 2 = I O _ P R O G D E S C return IO_PROGNAME??? will go to the next /0 char in memory
Parameter 3 = I O _ E R R O R /0 ? ?
Where Came from the Length in this ligne?
Column.Size := Length;
in this constructor
constructor TDBXDynalinkReader.Create(DBXContext: TDBXContext;
Can it be add by 1 to make sure that /0 is at the end?
? dbxoodbc version
please use '3.100 (2008-05-12)' from:
http://open-dbexpress.cvs.sourceforge.net/open-dbexpress/dbxoodbc/
new version dbxoodbc will leave in 2 days
DbxOpenOdbc.pas
--- BEGIN CUT: ---
const
DbxOpenOdbcVersion = '3.100 (2008-05-12): Beta';
--- END CUT. ---
For debug:
module: DbxOpenOdbc.pas
method: function TSqlCursorOdbc.getString
I have made a little modification.
I have had a option in TConnectionOptions (coSysNaming) default to "osoff"
when driver is eOdbcDriverTypeIbmDb2AS400 turn it to "osOn"
In procedure TSqlCursorMetaDataProcedureParams.FetchProcedureParams;
add a internal procedure
SysNamingSchema : String;
//Added by Sebastien to remove duplicated parameter
function RetrieveProcedureSchemaForSysNaming(pProcName : PAnsiCHAR) : String;
var
Len: LongWord;
Cursor: ISQLCursor25;
aStoredProcSchema: string;
IsBlank: LongBool;
aResult: SQLResult;
begin
aResult := self.fOwnerMetaData.getProcedures(pProcName,0,Cursor);
if aResult = SQL_SUCCESS then begin
Cursor.getColumnLength(3,Len);
SetLength(aStoredProcSchema,Len+1);
aResult := Cursor.next;
if aResult = SQL_SUCCESS then begin
Cursor.getString(3, PAnsiChar(aStoredProcSchema), IsBlank);
result := aStoredProcSchema;
end;
end;
end;
begin
(....)
ParseTableName(SearchCatalogName, SearchSchemaName, SearchProcedureName);
if (fSqlConnectionOdbc.fConnectionOptions[coSysNaming] = osOn) then
begin
SysNamingSchema := RetrieveProcedureSchemaForSysNaming(SearchProcedureName);
OdbcRetcode := SQLProcedureColumns(fHStmt,
fMetaCatalogName, SQL_NTS, // Catalog name
pAnsiChar(SysNamingSchema), SQL_NTS, // Schema name
fMetaTableName, SQL_NTS, // Procedure name match pattern
SearchParamName, SQL_NTS); // Column name match pattern
end
else
begin
OdbcRetcode := SQLProcedureColumns(fHStmt,
fMetaCatalogName, SQL_NTS, // Catalog name
fMetaSchemaName, SQL_NTS, // Schema name
fMetaTableName, SQL_NTS, // Procedure name match pattern
SearchParamName, SQL_NTS); // Column name match pattern
end;
if OdbcRetcode <> OdbcApi.SQL_SUCCESS then
OdbcCheck(OdbcRetcode, 'SQLProcedureColumns');
Thanks is the modification that I have done for Iseries driver for naming convention "sysnaming"
I have added your changes (AS 400) into new version "3.200, 2008-09-18".
Changes:
-------------------------
+ Added support Delphi 2009 (for details see ChangesLog.Txt)
+ DbxObjectParser.pas: optimization and fixed regexp expression for mssql
+ fixed read stored proc parameters for Db2AS400 (eOdbcDriverTypeIbmDb2AS400)
+ update FastMM4.pas to 4.90
+ chahged RegExprParser.zip - regexp tools (for DbxObjectParser.pas).
+ fixed stored proc for unicode
+ added oracle demo: Source\Demos\DBMS\ORACLE\RefCursor\ORARefCursor.dpr (ftCursor).