Re: [Harbour] Error with ODBC under rddsql (sddodbc) ...

2010-04-06 Thread Mindaugas Kavaliauskas

I try to test dBUseArea() with DBFCDX RDD  and  SQLMIX RDD ...
Since I cannot test the test2.prg under \hb20\contrib\rddsql\sddodbc\tests
I modify test2.prg into tstmysql.prg as follow:
However the line:   ? dBUseArea( .T., sqlmix, SELECT * FROM country,
country, .T., .F.)
with error comes out :
http://www.mingyik.com/dnload/tstodbc10.jpg
http://www.mingyik.com/dnload/tstodbc20.jpg


Hi,


you error screen shows the reason of error. SDDODBC/1906 means statement 
allocation error. Your sample generates error on dbusearea(), but does 
not generates error on RDDINFO(RDDI_EXECUTE,), though both actions do 
statement allocation. Current code uses mixed statement allocation:

  SQLAllocStmt() in RDDI_EXECUTE
and
  SQLAllocHandle( SQL_HANDLE_STMT, )  in DBUSEAREA()

Microsoft says: In ODBC 3.x, the ODBC 2.x function SQLAllocStmt  has 
been replaced by SQLAllocHandle.


Can you test sddodbc.c, by changing line #339 from
   if ( ! SQL_SUCCEEDED( SQLAllocHandle( SQL_HANDLE_STMT, 
pSDDConn-hConn, hStmt ) ) )

to
   if ( ! SQL_SUCCEEDED( SQLAllocStmt( pSDDConn-hConn, hStmt ) ) )
?

If this helps, we will need some additional compile switches to use 
different ODBC API version.




Regards,
Mindaugas
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Error with ODBC under rddsql (sddodbc) ...

2010-04-05 Thread Shum

Hi All,

I try to test dBUseArea() with DBFCDX RDD  and  SQLMIX RDD ...
Since I cannot test the test2.prg under \hb20\contrib\rddsql\sddodbc\tests
I modify test2.prg into tstmysql.prg as follow:
However the line:   ? dBUseArea( .T., sqlmix, SELECT * FROM country,
country, .T., .F.)
with error comes out :
http://www.mingyik.com/dnload/tstodbc10.jpg
http://www.mingyik.com/dnload/tstodbc20.jpg


/*
 * $Id$
 */

#include simpleio.ch
#include hbrddsql.ch

REQUEST SQLMIX, SDDODBC, DBFCDX

PROC main()
   LOCAL nConnection, nI, aI

   local aStruct := { { CHARACTER, C, 25, 0 }, ;
  { NUMERIC,   N,  8, 0 }, ;
  { DOUBLE,N,  8, 2 }, ;
  { DATE,  D,  8, 0 }, ;
  { LOGICAL,   L,  1, 0 } }

   RDDSETDEFAULT( SQLMIX )
   SET( _SET_DATEFORMAT, -mm-dd )
// nConnection := RDDINFO( RDDI_CONNECT, { ODBC,
Server=localhost;Driver={MySQL ODBC 5.1
Driver};dsn=;User=test;database=test; } )
   nConnection := RDDINFO( RDDI_CONNECT, { ODBC, dsn=testmysql; } )
   IF nConnection == 0
  ? Unable connect to server, RDDINFO( RDDI_ERRORNO ), RDDINFO(
RDDI_ERROR )
  RETURN
   ENDIF

   ? Database Connection: + LTrim(Str(nConnection)) +   OK  with
dsn=testmysql;
   ? RDDINFO(RDDI_EXECUTE, DROP TABLE country)
   ? RDDINFO(RDDI_EXECUTE, CREATE TABLE country (CODE char(3), NAME
char(50), RESIDENTS int(11)))
   ? RDDINFO(RDDI_EXECUTE, INSERT INTO country values ('LTU', 'Lithuania',
3369600),('USA', 'United States of America', 305397000), ('POR', 'Portugal',
10617600), ('POL', 'Poland', 38115967), ('AUS', 'Australia', 21446187),
('FRA', 'France', 64473140), ('RUS', 'Russia', 14190))

   ? dBUseArea( .T., sqlmix, SELECT * FROM country, country, .T., .F.)
   ? Rdd: SQLMIX   Alias:  +Alias()+BOF() is + IIF(Bof(), TRUE,
FALSE)

   dBCreate( testdbf, aStruct, DBFCDX )
   dBUseArea( .T., dbfcdx, testdbf.dbf, TESTALS, .T., .F. )
   ? Rdd: DBFCDX   Alias:  +Alias()+BOF() is + IIF(Bof(), TRUE,
FALSE)

   DBCLOSEALL()
RETURN



Shum
-- 
View this message in context: 
http://n2.nabble.com/Error-with-ODBC-under-rddsql-sddodbc-tp4852373p4852373.html
Sent from the harbour-devel mailing list archive at Nabble.com.
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Error with ODBC under rddsql (sddodbc) ...

2010-04-05 Thread Viktor Szakáts
Hi,

On Mon, Apr 5, 2010 at 8:00 AM, Shum wcshu...@hotmail.com wrote:

 Hi All,

 I try to test dBUseArea() with DBFCDX RDD  and  SQLMIX RDD ...
 Since I cannot test the test2.prg under \hb20\contrib\rddsql\sddodbc\tests
 I modify test2.prg into tstmysql.prg as follow:
 However the line:   ? dBUseArea( .T., sqlmix, SELECT * FROM country,
 country, .T., .F.)
 with error comes out :
 http://www.mingyik.com/dnload/tstodbc10.jpg

There is also a display bug here, which I hope someone can verify.

Brgds,
Viktor
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour