FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FiveDBU with ADO support
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
FiveDBU with ADO support
Posted: Fri May 03, 2013 09:54 AM
This is a work in development, though actually you can review Access databases. If you change the connection string inside FiveDBU.prg then you could manage other databases engines. Future versions will be able to choose the database engine:

https://code.google.com/p/fivewin-contributions/downloads/detail?name=fivedbu_20130503.zip

Full source code included :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Fri May 03, 2013 10:20 AM
Enahnced version that allows to review the structure of an ADO table:

https://code.google.com/p/fivewin-contributions/downloads/detail?name=fivedbu_20130503_2.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Fri May 03, 2013 03:27 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Fri May 03, 2013 04:53 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 09:29 AM
Enhanced function recordset save record in fivedbu.prg:

Code (fw): Select all Collapse
static function RSSaveRecord( oRS, aRecord, nRecNo )

   local n
 
   if oRS:AbsolutePosition != nRecNo 
      oRS:Move( nRecNo, 0 )
   endif   
 
   for n = 1 to oRS:Fields:Count
      TRY
         if oRS:Fields[ n - 1 ]:Attributes != 90 // non updateable
            oRS:Fields[ n - 1 ]:Value = aRecord[ n, 2 ]
         endif   
      CATCH
      END   
   next      

   oRS:Update()

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 01:51 PM
Antonio

I have not looked at your code .. but since the first ADO version .. I do get a table list but when I select any table I get this error.. the .mdb I am testing does not have a password so using a direct connection will open the database.

Rick Lipkin



Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 02:36 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 02:38 PM

Rick,

Could you email me your database ? thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 04:40 PM
Implementing the queries builder:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 05:58 PM

Antonio

I sent you the sample Access database ( 11mg ) via YouSendIt.com addressed to your gmail account.

Let me know if you do not receive it to download.

Thanks
Rick Lipkin

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 06:12 PM
Rick,

I already got your file, tested it and got your same error. Then I googled for it and found this:

http://www.datanumen.com/aar/errors/no-read-permission.htm

However, if you are sure you have the permission on the object, but still get this error, then it is very likely that the object information and property data are partially corrupted and Microsoft Access thinks you have no read permission for the specific object mistakenly.

it seems as that error means a corrupted access database that has to be repaired. Does Access provide that feature ? I don't think we can do that with ADO...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 07:06 PM

Antonio

The .mdb I sent you is a legacy database that I inherited for an invoicing application I have re-built using ADO ( ms jet ).

I did try a different .mdb ( much simpler ) and it did open with FiveDbu. The database I sent you has had relations and queries stripped from it and I did compact and repaired it before I sent it to you.

I can tell you that I do not have any problems opening recordsets or connections with the .mdb I sent you :|

Let me play with your code next week and see if I can tweak it to use the .mdb I sent you.

Thanks
Rick Lipkin

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Sat May 04, 2013 07:27 PM

Rick,

thanks so much for your great feedback and help :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: FiveDBU with ADO support
Posted: Sun May 05, 2013 06:48 PM

Antonio,

Thank you for the modified version with connection-string.I have tested it with this result.

Result with SQLite.
It's working nice. The only problem is that you can't edit an empty field. It's only possible to edit a field, if something is already in the field.

Result with MySQL.
The connection is working, but it's not possible to browse the fields since you still have to select a database after the connection, and that is not possible, because the database is already specified by IP-adress in the connection-string. It's not a real file...

That is also a little problem when you specify a SQLite-database. Here I can select the file, after entering the connection-string, but this is normaly not needed, because the file is already specified in the connection-string.

I suggest to directly browse the database, after entering the connection-string..

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveDBU with ADO support
Posted: Mon May 06, 2013 10:35 AM
Marc,

Many thanks for your great feedback :-)

I have just published an enhanced version that manages in a better way the connection string:

https://code.google.com/p/fivewin-contributions/downloads/detail?name=fivedbu_20130506.zip

Would you mind to email me a SQLite database to test here ? Also the connection string and if there is something to install on the pc, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com