ADODB MySql! ( Solved! )

Re: ADODB MySql error!

Postby JC » Mon Jan 26, 2009 6:43 pm

Exists any incompatibility with fields like timestamp?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql error!

Postby Enrico Maria Giordano » Mon Jan 26, 2009 7:27 pm

JC wrote:Antonio and friends,

This is my example for testing!
Please, modify and check!

http://rapidshare.com/files/189783905/ADODB.zip.html


I get

Application
===========
Path and name: E:\FWXHARB\ADODB.EXE (32 bits)
Size: 1,675,264 bytes
Time from start: 0 hours 0 mins 5 secs
Error occurred at: 01/26/09, 20:26:40
Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: ACTIVECONNECTION
Args:
[ 1] = L .F.

Stack Calls
===========
Called from: source\rtl\win32ole.prg => TOLEAUTO:ACTIVECONNECTION(0)
Called from: ADODB.prg => MYSQLRECORDSET(152)
Called from: ADODB.prg => EXECCONNECTION(29)
Called from: ADODB.prg => MAIN(14)


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ADODB MySql error!

Postby JC » Mon Jan 26, 2009 7:33 pm

Enrico,

You must be change the connectionString to your own configutarion:

Code: Select all  Expand view
cConnectionString := "Driver={MySQL ODBC 5.1 Driver}" + ;
                     ";Server=127.0.0.1"              + ;
                     ";DefaultDatabase=genesis"       + ;
                     ";Database=aservit"              + ;
                     ";Port=3306"                     + ;
                     ";User=genesis"                  + ;
                     ";Password=genesis"              + ;
                     ";Option=3;"
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql error!

Postby Enrico Maria Giordano » Mon Jan 26, 2009 7:36 pm

Sorry, I haven't MySql to test your sample.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ADODB MySql error!

Postby JC » Mon Jan 26, 2009 7:40 pm

Enrico Maria Giordano wrote:Sorry, I haven't MySql to test your sample.

EMG


Don't have problem Enrico.. ;)
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql error!

Postby Armando » Mon Jan 26, 2009 8:07 pm

Julio:

I have tested your code, I modify the connection string (obviously), and
It works fine to me!.

Look
Image

Image

Image

NOTE: I use 3.51 driver

Regards
Last edited by Armando on Mon Jan 26, 2009 9:25 pm, edited 1 time in total.
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3215
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: ADODB MySql! Please Antonio...

Postby JC » Mon Jan 26, 2009 9:23 pm

Armando,

The problem is with fields that's type is timestamp!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql! Please Antonio...

Postby JC » Mon Jan 26, 2009 10:46 pm

Dear friends,

Maybe the error is on datatype convertion of xHarbour, for fields like TIMESTAMP!

If you make a cast convertion, works!

reg_id = numeric, auto_increment, not null
reg_data = timestamp, notnull, default '0000-00-00 00:00:00'
reg_update = timestamp, notnull, default '0000-00-00 00:00:00'

Error:
Code: Select all  Expand view
SELECT reg_id, reg_data, reg_update FROM mytable ORDER BY reg_update DESC

When the field is filled with any value like '2009-01-27 16:42:25', the ADO return this value like this 2009-01-27, as date

Ok:
Code: Select all  Expand view
SELECT reg_id, CAST( reg_data AS CHARACTER ) AS reg_data, CAST( reg_update AS CHARACTER ) AS reg_update FROM mytable ORDER BY reg_update DESC

In this case, any value of field return a value like this '2009-01-27 16:42:25' as string (because typecast)


And xBrowse do not show the complete value of field... only the data part!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql! Please Antonio...

Postby JC » Tue Jan 27, 2009 12:48 pm

Someboby?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql! Doubts to anybody!

Postby JC » Fri Jan 30, 2009 4:54 pm

I still have the problem, if somebody can help me.. thanks
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql! Doubts to anybody!

Postby JC » Mon Feb 02, 2009 6:47 pm

Dear friends,

Thanks for all! I can make this! Now, all it's ok with ADBODB.Connection, ADBODB.RecordSet and ADBODB.Stream with MySQL, PostgreSQL and Oracle... all they with Fivewin 8.10!

Thank so much!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: ADODB MySql! Please Antonio...

Postby goosfancito » Mon Jul 06, 2009 2:55 pm

Es lo que me andaba pasando.

gracias.


JC wrote:Dear friends,

Maybe the error is on datatype convertion of xHarbour, for fields like TIMESTAMP!

If you make a cast convertion, works!

reg_id = numeric, auto_increment, not null
reg_data = timestamp, notnull, default '0000-00-00 00:00:00'
reg_update = timestamp, notnull, default '0000-00-00 00:00:00'

Error:
Code: Select all  Expand view
SELECT reg_id, reg_data, reg_update FROM mytable ORDER BY reg_update DESC

When the field is filled with any value like '2009-01-27 16:42:25', the ADO return this value like this 2009-01-27, as date

Ok:
Code: Select all  Expand view
SELECT reg_id, CAST( reg_data AS CHARACTER ) AS reg_data, CAST( reg_update AS CHARACTER ) AS reg_update FROM mytable ORDER BY reg_update DESC

In this case, any value of field return a value like this '2009-01-27 16:42:25' as string (because typecast)


And xBrowse do not show the complete value of field... only the data part!
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: ADODB MySql! ( Solved! )

Postby nageswaragunupudi » Mon Jul 06, 2009 5:20 pm

XBrowse shows date part of DateTime values of xHarbour ( including TimeStamp field values of ADO ) by default. If we want full date time value to be shown in xBrowse, we should set oCol:cDataType := 'T'. Then xBrowse shows the values with date and time.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wartiaga and 91 guests