[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-12 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #17 by zxMarce:

Christian,

Thanks for your feedback.
I'll try to add the further patch for retrieving the database name to gb.odbc 
and send the updated component sources to Benoît for publishing.

Regards,
zxMarce.

zxMarce changed the state of the bug to: Fixed.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-11 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #16 by Christian FAURE:

Thanks! 
new version of GetRecordCount() work fine with Firebird database!!!
---
gb.db.odbc: 0xea8148: select current_date as MyDate from RDB$DATABASE
gb.db.odbc.GetRecordCount: First recno=0
gb.db.odbc.GetRecordCount: Last recno=0
gb.db.odbc.GetRecordCount: Record count=1
gb.db.odbc: -> 1 rows
Result Available!
11/11/2016 00:00:00
---



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-11 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #15 by Benoît MINISINI:

The open_database() driver function takes a DB_DESC structure pointer as first 
argument.

Modify the name in that structure that way:

GB.FreeString(POINTER(>name));
desc->name = GB.NewZeroString(my_new_database_name);

Anyway, maybe you should take into account the name provided by the user, 
possibly adding it to the connection string? If possible, I don't know the ODBC 
connection string format well.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-11 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #14 by zxMarce:

Benoît,

Actually, it was not that hard. The subtraction trick did its job flawlessly 
(and fast, even with the additional API calls), and the function even worked as 
expected when faced a row-less query.
In retrospective, I should already had known better than to assume "all records 
start at 1", when I know the SQL "standard" is not such ;)
Moreover, given that there are many more RDBMs out there (most unknown to me), 
having the component remember details for each type would not be a good idea, 
and kind of contrary to the whole ODBC concept of standardizing RDBM access as 
much as possible.

But now that I have your attention, Benoît, I'd like to ask you a question 
instead.
The usual Gambas Connection object use .Host for the host name and .Name for 
the desired database ("catalog" for MSSQL) to connect.
When using a ConnectionString, though, .Name returns either empty or the whole 
connstring, which I think is undesirable. It should, IMO, hold the database 
name, as expected.
But, alas, I cannot pinpoint in the ODBC component the correct 
object/place/struct/string to populate with the DB Name!

Can you lend a hand and point me in the right direction?



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-11 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #13 by Benoît MINISINI:

Just a remark: if it is too hard to make a generic GetRecordCount() method, you 
can store in your database connection object the underlying ODBC connection type
so that you can use a different method in each case.

If I'm connected to a SqlServer database, do the count that way,
If I'm connected to a Firebird database, do the count that other way,
Otherwise use this default method.

What do you think?

Benoît MINISINI changed the state of the bug to: Working.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-11 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #12 by zxMarce:

Christian,

Well, it looks like my guess was correct. I patched the function so it now does 
as follows:

  1- Remember the current RowIndex
  2- Fetch the index of the first record (firstIndex)
  3- Fetch the index of the last record (lastIndex)
  4- Go back to the original RowINdex from step 1
  5- Return (lastIndex - firstIndex + 1) as rowcount.

This change yielded correct SELECT row count for MSSQL:

  gb.db.odbc: 0x84cc934: SELECT * FROM SampleTable ORDER BY Field1, Field2
  gb.db.odbc.GetRecordCount: First recno=1
  gb.db.odbc.GetRecordCount: Last recno=63
  gb.db.odbc.GetRecordCount: Record count=63
  gb.db.odbc: -> 63 rows

And also corrected the mishaps for FB, for both a SELECT and a SELECT COUNT(), 
and you can see that the first record is 0 and not 1 like in MSSQL:

  gb.db.odbc: 0x84cc934: SELECT * FROM Colors
  gb.db.odbc.GetRecordCount: First recno=0
  gb.db.odbc.GetRecordCount: Last recno=7
  gb.db.odbc.GetRecordCount: Record count=8
  gb.db.odbc: -> 8 rows

  gb.db.odbc: 0x84cc934: SELECT COUNT(*) FROM Colors
  gb.db.odbc.GetRecordCount: First recno=0
  gb.db.odbc.GetRecordCount: Last recno=0
  gb.db.odbc.GetRecordCount: Record count=1
  gb.db.odbc: -> 1 rows

The current problem I have now is that I get nice SEGFAULTs when I run an USE 
 command on MSSQL:

  gb.db.odbc: 0x9db15ac: USE Redemption
  gb.db.odbc: SQLFetchScroll SQL_FETCH_FIRST
  gb.db.odbc: H:1:0:[FreeTDS][SQL Server]Fetch type out of range
  gb.db.odbc: -> -1 rows
  [SEGFAULT!]

So, the function is returning -1 as expected on failure (error occurs when 
trying to fetch the first record from a recordless command), so the SEGFAULT 
problem seems to be elsewhere and not in GetRecordCount().

If you want to add the patch yourself and recompile and use the new component, 
you can grab the following code and give it a try:

/* zxMarce: This is one way -hope there's an easier one- to retrieve a rowset
*  count for SELECT statements. Four steps (must have an scrollable cursor!):
*1- Remember the current row.
*2- Seek down to the last row in the rowset
*3- Get the last row's index (recno)
*4- Seek back to wherever we were at in step 1
*  20161110 zxMarce: Ok, it did not work that OK for Firebird; it looks like
*  the FB driver returns one-less than the record count (record count seems to
*  be zero-based), so we will instead do as follows, if we have a scrollable
*  recordset:
*1- Remember the current row.
*2- Seek up to the first row in the rowset
*3- Get the first row's index (firstRecNo)
*4- Seek down to the last row in the rowset
*5- Get the last row's index (lastRecNo)
*6- Seek back to wherever we were at in step 1
*7- Return (lastRecNo - firstRecNo + 1).
*/
int GetRecordCount(SQLHANDLE stmtHandle, SQLINTEGER cursorScrollable)
{
SQLRETURN retcode;  //ODBC call return values
int formerRecIdx = 0;   //Where we were when this all started.
SQLINTEGER myRecCnt = -1;   //Default for when there's no cursor.
SQLINTEGER firstRecNo = 0;  //2016 holder for 1st recno.
SQLINTEGER lastRecNo = 0;   //2016 holder for last 
recno.
char mssg[128]; //Error reporting text.

//Make sure the statement has a cursor
if (!(stmtHandle && (cursorScrollable == SQL_TRUE)))
{
if (DB.IsDebug())
{
fprintf(stderr, "gb.db.odbc: Cannot do 
GetRecordCount()!\n");
}
return ((int) myRecCnt);
}

//Tell ODBC we won't be actually reading data (speeds process up).
//SQL_ATTR_RETRIEVE_DATA = [SQL_RD_ON] | SQL_RD_OFF
retcode = SQLSetStmtAttr(stmtHandle, SQL_ATTR_RETRIEVE_DATA, 
(SQLPOINTER) SQL_RD_OFF, 0);
if (!SQL_SUCCEEDED(retcode))
{
reportODBCError("SQLSetStmtAttr SQL_ATTR_RETRIEVE_DATA",
stmtHandle,
SQL_HANDLE_STMT);
}

//Fetch current row's index so we can return to it when done.
retcode = SQLGetStmtAttr(stmtHandle, SQL_ATTR_ROW_NUMBER, 
, 0, 0);
if (!SQL_SUCCEEDED(retcode))
{
reportODBCError("SQLGetStmtAttr SQL_ATTR_ROW_NUMBER",
stmtHandle,
SQL_HANDLE_STMT);
}

//Try to get (back?) to the first record, abort if not possible.
retcode = SQLFetchScroll(stmtHandle, SQL_FETCH_FIRST, (SQLINTEGER) 0);
if (!SQL_SUCCEEDED(retcode))
{
reportODBCError("SQLFetchScroll SQL_FETCH_FIRST", stmtHandle, 
SQL_HANDLE_STMT);
retcode = SQLSetStmtAttr(stmtHandle, SQL_ATTR_RETRIEVE_DATA, 
(SQLPOINTER) SQL_RD_ON, 0);
return ((int) myRecCnt);
} else {

[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-10 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #11 by Christian FAURE:

Well, thanks zxMarce for the information, very appreciated work.

Best regards.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-11-10 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #10 by zxMarce:

Christian,

Finally! I installed FB2.5, the ODBC driver, and even got a simple test DB with 
an eight record table, hand populated with ye olde ZX-Spectrum colors (fields 
ColorName and ColorValue).
Also connected to it successfully with a Connection String instead of an 
INI-based DSN. Sweet!

I think I may have a little insight regarding this issue, not having done yet 
any code changes.
The problem *seems* to be that the rec count routine does its work, but for 
some reason FB driver returns a zero-based record count.
When I run "SELECT * FROM Colors", I get back 7 records instead of 8. When I 
run "SELECT COUNT (*) FROM Colors" or "SELECT AVG (ColorValue) FROM Colors" 
instead, I get -as you do- 0 records back.
All of these statements work correctly on FlameRobin, of course!

Benoît further patched gb.db so when it gets back a record count of -1 the 
component simply keeps getting records until there are no more; that is why it 
works with SQLRowCount() which, as you know, returns -1.
When gb.db gets anything besides -1, it will loop fetching as many records as 
told. In the case of FB, it fails to retrieve correctly because the low-level 
driver returns a zero-based count via unixODBC.

Paraphrasing Matt Damon in "The Martian": I will have to science the f*ck out 
of it. Will start burning some neurones.

zxMarce changed the state of the bug to: Working.



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-28 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #9 by Christian FAURE:

Thanks for your time, the response time is not critical for me.
My current setup is Firebird 2.5.6 (Classic) with libOdbcFb.so 2.0.2,
i've seen an libOdbcFb.so version 2.0.4 available on firebird site.
Version 3 of firebird not tested yet.



--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-28 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #8 by zxMarce:

Christian,

Sorry for the time it takes for me to answer.

Well, the example code is correct (and I have seen it before), but if you 
follow the SQLRowCount() link in the explanatory text you get to the call's 
documentation, which says:

  SQLRowCount
returns the number of rows affected by INSERT, UPDATE or DELETE. Many 
drivers (but not all) return the number of rows returned by the last executed 
SELECT statement too.

The important bit here is "Many drivers (but not all)". That alone makes an 
important part of Gambas fail with "some" database engines, and the worst part 
is that there's no way to know whether the called driver supports or not 
returning row counts for SELECT statements.

What's worse, if you think of it, the call should actually always fail for 
SELECT statements, because on a multithreaded multiuser RDBMS, there's always 
the chance that another thread/user adds or deletes records while your SELECT 
runs, making the call lie to you!

Let me find out what to do by installing a FB DB and its ODBC driver as I said 
earlier. I guess I'll use some sort of IF statement. When I get a SQLRowCount() 
of -1 (the default value for MSSQL if memory serves), I'll make the component 
call my alternate routine; otherwise, I'll keep what SQLRowCount() returns. But 
before implementing, I must test.

To mimic your setup as much as possible, please tell me what version of FB 
Server to get (I'm using Ubuntu 16.04 Desktop, and when I tried to install it I 
found there are a lot of FB flavors) and where should I get the same ODBC 
driver you're using if at all possible.

Sounds like we have a plan?



--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-13 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #7 by Christian FAURE:

after reading a bit of documentation,
as you say, the SQLRowCount is for updates/inserts/deletes not for Selects,
but at unixodbc site they indicates to use SQLRowCount for selects:
http://www.unixodbc.org/doc/ProgrammerManual/Tutorial/resul.html



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-13 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #6 by Christian FAURE:

Thanks for explain the SQLRowCount,
i've tested with column name, but result is the same:
---
gb.db.odbc: 0xe40a48: select current_date as MyDate from RDB$DATABASE
gb.db.odbc.GetRecordCount: Success, count=0
gb.db.odbc: -> 0 rows
Result not Available
---



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-13 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #5 by zxMarce:

I will create a FB DB in my machine and will test this.

Normally, as per the documentation, ODBC's SQLRowCount() only return a valid 
row count for INSERT and DELETE statements.
But Gambas does need a 'proper' row count. Therefore, I created the 
GetRecordCount().

What I noticed, but have no idea if it will affect the result, is that your 
query does not have a column.

Please try this query with both calls (SQLRowCount() and GetRecordCount()) to 
see if it makes a difference:

  SELECT current_date AS MyDate FROM RDB$DATABASE

Thanks.



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-13 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #4 by Christian FAURE:

If you want, i can run a firebird database instance at home and provide the ip 
address, port and login (via private mail) to test/debug
let me know.



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-13 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #3 by Christian FAURE:

Thanks for review this problem,

this is the test code:
  Print "---"
  FBConnect() ' connect to database
  Db.Debug = True ' enable debug messages
  Try rs = fb.Exec("select current_date from RDB$DATABASE") 'this select always 
return one row with current date
  If Error.Code Then
Print "Error";; Error.Text;; Error.Code
  Endif
  If rs.Available Then
Print "Result Available!"
Print rs[0]
  Else
'when GetRecordCount give 0 rows, then rs.Available is false
Print "Result not Available"
  Endif
  Print "---"

with unmodified source (gambas 3.9.1 - 2.11 from openSuse 42.1) the console 
show:

---
gb.db.odbc: 0xb6da38: select current_date from RDB$DATABASE
gb.db.odbc.GetRecordCount: Success, count=0
gb.db.odbc: -> 0 rows
Result not Available
---

i'm sure this select return one row.
then i've modified the odbc component (source from gambas site, v 3.9.1), 
function do_query like this 

/* Internal function to implement the query execution */
static int do_query(DB_DATABASE *db, const char *error, ODBC_RESULT ** res, 
const char *qtemp, int nsubst, ...)
{

#ifdef ODBC_DEBUG_HEADER
fprintf(stderr,"[ODBC][%s][%d]\n",__FILE__,__LINE__);
fprintf(stderr,"\tdo_query db %p, ODBC_result res %p, db->handle %p, query = 
'%s'\n", db, res, db->handle, query);
fflush(stderr);
#endif

va_list args;
ODBC_CONN *handle = (ODBC_CONN *)db->handle;
SQLRETURN retcode= SQL_SUCCESS;
SQLRETURN retcodecnt= SQL_SUCCESS;
ODBC_RESULT * odbcres;
const char *query;
int i;

if (nsubst)
{
va_start(args, nsubst);
if (nsubst > 3)
nsubst = 3;
for (i = 0; i < nsubst; i++)
query_param[i] = va_arg(args, char *);

query = DB.SubstString(qtemp, 0, query_get_param);
}
else
query = qtemp;

if (DB.IsDebug())
fprintf(stderr, "gb.db.odbc: %p: %s\n", handle, query);

GB.AllocZero(POINTER(), sizeof(ODBC_RESULT));

/* Allocate the space for the result structure */

retcode = SQLAllocHandle(SQL_HANDLE_STMT, handle->odbcHandle, 
>odbcStatHandle);
if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO))
{
GB.Error("Cannot allocate statement handle");
return retcode;
}

retcode = SQLSetStmtAttr(odbcres->odbcStatHandle, 
SQL_ATTR_CURSOR_SCROLLABLE, (SQLPOINTER) SQL_SCROLLABLE, 0);
if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO))
{
odbcres->Cursor_Scrollable = SQL_FALSE;
}
else odbcres->Cursor_Scrollable = SQL_TRUE;

odbcres->Function_exist = handle->FetchScroll_exist;

/* Execute the query */
retcode = SQLExecDirect(odbcres->odbcStatHandle, (SQLCHAR *) query, 
SQL_NTS);
if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO))
{
SQLFreeHandle(SQL_HANDLE_STMT, odbcres->odbcStatHandle);
GB.Error("Error while executing the statement");
return retcode;
}

if (res)
{
/*retcode = SQLRowCount(odbcres->odbcStatHandle, 
>count);
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
{
SQLFreeHandle(SQL_HANDLE_STMT, odbcres->odbcStatHandle);
GB.Error("Unable to retrieve row count");
return retcode;
}*/
retcodecnt = SQLRowCount(odbcres->odbcStatHandle, >count);
if (retcodecnt != SQL_SUCCESS && retcodecnt != 
SQL_SUCCESS_WITH_INFO)
{
SQLFreeHandle(SQL_HANDLE_STMT, odbcres->odbcStatHandle);
GB.Error("Unable to retrieve row count");
return retcodecnt;
}

//odbcres->count = GetRecordCount(odbcres->odbcStatHandle, 
odbcres->Cursor_Scrollable);
if (DB.IsDebug())
fprintf(stderr, "gb.db.odbc: -> %d rows\n", 
(int)odbcres->count);
*res = odbcres;
}
else
{

SQLFreeHandle(SQL_HANDLE_STMT, odbcres->odbcStatHandle);
GB.Free(POINTER());
}

return retcode;
}

then the same gambas code print this on the console:
---
gb.db.odbc: 0x889a28: select current_date from RDB$DATABASE
gb.db.odbc: -> 1 rows
Result Available!
10/13/2016 00:00:00
---

maybe we can add some flag in database driver like "enable_optimizations" to 
enable the new GetRecordCount and/or other non odbc compliant tuned features?

Best regards.



--

[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-08 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Comment #2 by Benoît MINISINI:

From zxMarce:

Christian,

Hi. I made the GetRecordCount() function.

Can you please be more specific as why it does not work for you? I do not have 
an FB DB to test, so if you could please be clear as how it fails I'll 
appreciate it.

Thank you,
zxMarce.

Benoît MINISINI changed the state of the bug to: NeedsInfo.



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-10-08 Thread Benoît Minisini
Le 25/09/2016 à 23:14, d4t4f...@gmail.com a écrit :
> Christian,
>
> Hi. I made the GetRecordCount() function.
>
> Can you please be more specific as why it does not work for you? I do not 
> have an FB DB to test, so if you could please be clear as how it fails I'll 
> appreciate it.
>
> Thank you,
> zxMarce.

You should have answered directly in the bugtracker. I copy your mail in it.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-09-26 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

PICCORO LENZ MCKAY changed the state of the bug to: Opened.




--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-09-25 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

zxMarce changed the state of the bug to: NeedsInfo.




--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-09-25 Thread d4t4full
Christian,

Hi. I made the GetRecordCount() function.

Can you please be more specific as why it does not work for you? I do not have 
an FB DB to test, so if you could please be clear as how it fails I'll 
appreciate it.

Thank you,
zxMarce.



On Sep 25, 2016, 17:42, at 17:42, bugtrac...@gambaswiki.org wrote:
>http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-
>
>Christian FAURE reported a new bug.
>
>Summary
>---
>
>gb.db.odbc new GetRecordCount mechanism seem not work with firebird
>database
>
>Type : Bug
>Priority : Medium
>Gambas version   : Unknown
>Product  : Unknown
>
>
>Description
>---
>
>New GetRecordCount method always return zero when used with a Firebird
>test database.
>as workaround i've uncomented the old call to SQLRowCount and comented
>the new call to GetRecordCount
>
>
>
>
>
>--
>___
>Gambas-user mailing list
>Gambas-user@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/gambas-user
--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1013: gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

2016-09-25 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1013=L21haW4-

Christian FAURE reported a new bug.

Summary
---

gb.db.odbc new GetRecordCount mechanism seem not work with firebird database

Type : Bug
Priority : Medium
Gambas version   : Unknown
Product  : Unknown


Description
---

New GetRecordCount method always return zero when used with a Firebird test 
database.
as workaround i've uncomented the old call to SQLRowCount and comented the new 
call to GetRecordCount





--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user