Page 3 of 3

PostPosted: Sat Apr 14, 2007 12:30 am
by Rick Lipkin
This works .. if sql statement recordset returns no rows .. :D


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

PostPosted: Sat Apr 14, 2007 9:54 am
by Enrico Maria Giordano
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 ..


Code: Select all  Expand view
IF oRs:EOF
    // no records
ENDIF


or

Code: Select all  Expand view
IF oRs:RecordCount = 0
    // no records
ENDIF


EMG

PostPosted: Sat Apr 14, 2007 11:23 am
by Enrico Maria Giordano
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

PostPosted: Sat Apr 14, 2007 12:35 pm
by Rick Lipkin
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

PostPosted: Sat Apr 14, 2007 4:15 pm
by Enrico Maria Giordano
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

PostPosted: Sat Apr 14, 2007 6:09 pm
by Antonio Linares
Harbour's USRRDD could be used to easily implement an ADORDD and test how it goes :-)

PostPosted: Sat Apr 14, 2007 6:15 pm
by Enrico Maria Giordano
True. The problem with USRRDD is the lack of documentation and samples.

EMG

PostPosted: Sat Apr 14, 2007 11:15 pm
by Rick Lipkin
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

PostPosted: Sun Apr 15, 2007 9:41 am
by Enrico Maria Giordano
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 ..


Code: Select all  Expand view
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

PostPosted: Sun Apr 15, 2007 3:32 pm
by Rick Lipkin
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

PostPosted: Sun Apr 15, 2007 3:41 pm
by Enrico Maria Giordano
I'm using the following connection string:

Code: Select all  Expand view
"Provider=sqloledb;Data Source=ipaddress;User Id=userid;Password=password"


EMG