Hi All,

I continue to test sddodbc with mysql  for adding a BIGINT field ...but
error comes out :
  http://www.mingyik.com/dnload/tstodbc40.jpg
  http://www.mingyik.com/dnload/txtodbc50.jpg

the error comes out at the line with dBUsearea(...) 

and the source at follow:

/*
 * $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, "yyyy-mm-dd" )
// nConnection := RDDINFO( RDDI_CONNECT, { "MYSQL",
"localhost","root","mysql","test" } )
// 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), TD1 date, TN1 Numeric(10,2) default 0.00 )")
   RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME char(50),
RESIDENTS int(11), TD1 date, TB1 BIGINT default 0 )")
   RDDINFO(RDDI_EXECUTE, "INSERT INTO country (CODE, NAME, RESIDENTS) values
('LTU', 'Lithuania', 3369600),('USA', 'United States of America',
305397000), ('POR', 'Portugal', 10617600), ('POL', 'Poland', 38115967),
('AUS', 'Australia', 21446187), ('FRA', 'France', 64473140), ('RUS',
'Russia', 141900000)")

   ? dBUseArea( .T., "SQLMIX", "SELECT * FROM country ORDER BY CODE;",
"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-dBUseArea-with-rddsql-sddodbc-with-mysql-tp4861267p4861267.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

Reply via email to