FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to set up and Use an Access database
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 12:30 AM

This works .. if sql statement recordset returns no rows .. :D

IF oRS1:eof
Msginfo( "not found" )
RETURN(NIL)
ENDIF

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 09:54 AM
Rick Lipkin wrote:Why when I try to open a recordset and the sql statement does not find any results .. can I not try to trap a 'no find' situation ..


IF oRs:EOF
    // no records
ENDIF


or

IF oRs:RecordCount = 0
    // no records
ENDIF


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 11:23 AM
Rick Lipkin wrote:Looking for that magic INSERT sql statement and the connection string to update all the matching relational records and tables.


I think you have to issue several INSERT statement.

EMG
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 12:35 PM

Enrico

I think I came to that same conclusion .. many relational tables .. just apply insert updates to each instead of combining them all into one join ..

I can tell you .. this exersize has been a valuable lesson .. but thinking down the road .. I was toying with the idea of sqlrdd for a Ms Sql project coming up ..

Any feelings on ADO vs ( perhaps ) the sqlrdd ?? ... what has to be on the client to make the connection ?? .. for ms sql that is ?? I am very pleased with ADO speed and recordsets..

Thanks

Rick Lipkin

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 04:15 PM
Rick Lipkin wrote:Any feelings on ADO vs ( perhaps ) the sqlrdd ?? ... what has to be on the client to make the connection ?? .. for ms sql that is ??


An ADORDD would be a wrapper to ADO and could be very useful to keep xBase syntax. But conceptually xBase and SQL are two very different beasts and I'm still not sure if xBase syntax is the right path to follow.

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 06:09 PM

Harbour's USRRDD could be used to easily implement an ADORDD and test how it goes :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 06:15 PM

True. The problem with USRRDD is the lack of documentation and samples.

EMG

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
How to set up and Use an Access database
Posted: Sat Apr 14, 2007 11:15 PM

Enrico

One last ( I hope ) question .. I am using your :filter suggestion for locate records .. is there a :find() or :locate() method in ADO .. I just want to 'seek' a record in a recordset and move the pointer to that record ..

Also .. it appears that a recordset is ( like ) a 'local cursor' .. what are the visability of updates from one workstation recordset to another workstation ( recordset ) that may have the same table open .. does the UPDATE clause on the listbox allow the recordsets to be refreshed from the table .. or is it once the recorset is created .. it never goes back to the origional table for refreshes ??

Thanks again .. I will be converting a large dbfcdx app soon to ms sql .. I know if I go the ADO route i will have to re-write a good bit of code .. but a 'wrapper' ADO rdd would be nice...

Rick Lipkin

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to set up and Use an Access database
Posted: Sun Apr 15, 2007 09:41 AM
Rick Lipkin wrote:I am using your :filter suggestion for locate records .. is there a :find() or :locate() method in ADO .. I just want to 'seek' a record in a recordset and move the pointer to that record ..


oRs:Find( "Cliente LIKE 'A%'" )


This is where you can find the ADO reference:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmscadoapireference.asp

Rick Lipkin wrote:Also .. it appears that a recordset is ( like ) a 'local cursor' .. what are the visability of updates from one workstation recordset to another workstation ( recordset ) that may have the same table open .. does the UPDATE clause on the listbox allow the recordsets to be refreshed from the table .. or is it once the recorset is created .. it never goes back to the origional table for refreshes ??


It depends on the cursortype specified in the Open() method.

EMG
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
How to set up and Use an Access database
Posted: Sun Apr 15, 2007 03:32 PM

Enrico

Thank you VERY much .. I think you have the right open parameters set 1,3 .. from what I can tell .. visibility for edits are there and adopenkeyset supports the absolute position for records and top and bottom... where adopendynamic does not ..

I did see a :resync method .. going to have to set up a share on my home network here to test ..

I do find Antonio's comment interesting on ado wrappers intergrated into an RDD .. my only concern ( moving into a ms sql world soon ) .. what ado engine would have to be loaded on the workstation clients for MS Sql ?? .. I don't think MS office loads an ADO client for that particular connection ??

Rick Lipkin

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to set up and Use an Access database
Posted: Sun Apr 15, 2007 03:41 PM
I'm using the following connection string:

"Provider=sqloledb;Data Source=ipaddress;User Id=userid;Password=password"


EMG

Continue the discussion