FiveDBU with ADO support

FiveDBU with ADO support

Postby Antonio Linares » Fri May 03, 2013 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Antonio Linares » Fri May 03, 2013 3:27 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Antonio Linares » Fri May 03, 2013 4:53 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Antonio Linares » Sat May 04, 2013 9:29 am

Enhanced function recordset save record in fivedbu.prg:

Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Rick Lipkin » Sat May 04, 2013 1: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

Image

Image
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: FiveDBU with ADO support

Postby Antonio Linares » Sat May 04, 2013 2:36 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Antonio Linares » Sat May 04, 2013 2:38 pm

Rick,

Could you email me your database ? thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Antonio Linares » Sat May 04, 2013 4:40 pm

Implementing the queries builder:

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Rick Lipkin » Sat May 04, 2013 5: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: FiveDBU with ADO support

Postby Antonio Linares » Sat May 04, 2013 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Rick Lipkin » Sat May 04, 2013 7: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: FiveDBU with ADO support

Postby Antonio Linares » Sat May 04, 2013 7:27 pm

Rick,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveDBU with ADO support

Postby Marc Vanzegbroeck » Sun May 05, 2013 6: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: FiveDBU with ADO support

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests