How to set up and Use an Access database

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

Postby Enrico Maria Giordano » Sat Apr 14, 2007 9: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 ..


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
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Enrico Maria Giordano » Sat Apr 14, 2007 4: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
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Enrico Maria Giordano » Sat Apr 14, 2007 6:15 pm

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

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

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

Postby Enrico Maria Giordano » Sun Apr 15, 2007 9: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 ..


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
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rick Lipkin » Sun Apr 15, 2007 3: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
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Enrico Maria Giordano » Sun Apr 15, 2007 3:41 pm

I'm using the following connection string:

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


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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 29 guests