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