Question about SQL

Postby vailtom » Thu Nov 22, 2007 10:42 am

Vailton Renato
User avatar
vailtom
 
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm

Postby cdmmaui » Thu Nov 29, 2007 5:14 am

Hello,

Is there a small sample program available that allows me to connect to a table, browse, search, add a record, edit a record and delete a record. I am considering switching from DBF to SQL; but I am completely new to SQL. I own MSSQL, but my clients may want to use a less expensive version of SQL, what SQL would you recommend? What would be a good reference guide for converting my application to SQL especially converting the data? I would also need to write web based code to access the same SQL data. I would appreciate your feedback.

Thank you!
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby Manuel Valdenebro » Sun Dec 30, 2007 6:42 pm

Rick Lipkin wrote:Michel
@ 0, 0 LISTBOX oBrow FIELDS ;
oRs:Fields("CODE"):Value, ;
oRs:Fields("DESC"):Value, ;
oRs:Fields("progid"):Value ;
SIZES 80,250,80 ;
HEADERS "Code", ;
"Description", ;
"ProgID" ;
of oGRP


Rick,

I am using that code (Thanks to RF) with Oracle DB successfully. But with table (dbf) i was using "oLbx:nClrPane:={|| IIF((oLbx:cAlias)->(OrdKeyNo())%2==0,CLR_LGREEN,CLR_LGRAY)}" for changing rows colors and now i can not using with array. Do you know how i can doing?

Regards
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Postby nageswaragunupudi » Sun Dec 30, 2007 6:52 pm

Please try
Code: Select all  Expand view  RUN
oLbx:nClrPane:={|| IIF(oRs:AbsolutePisition % 2==0,CLR_LGREEN,CLR_LGRAY)}
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby nageswaragunupudi » Sun Dec 30, 2007 7:08 pm

Sorry
AbsolutePosition
not
AbsolutePisition

Sorry for the spelling mistake
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Rick Lipkin » Sun Dec 30, 2007 8:59 pm

Manuel

Try this code based on a specific fields in your table .. the colors are based on dates in each row..

Rick


oBRW:nClrText := ;
{ || SelColor( oRs:Fields("code"):Value,oRs:Fields("DEL_CODE"):Value,oRs:Fields("EXPIR_DATE"):Value,oRs:Fields("DELETED"):Value,"F" ) }
oBRW:nClrPane := ;
{ || SelColor( oRs:Fields("code"):Value,oRs:Fields("DEL_CODE"):Value,oRs:Fields("EXPIR_DATE"):Value,oRs:Fields("DELETED"):Value,"B" ) }
oBrw:nClrForeFocus := ;
{ || SelColor( oRs:Fields("code"):Value,oRs:Fields("DEL_CODE"):Value,oRs:Fields("EXPIR_DATE"):Value,oRs:Fields("DELETED"):Value,"F" ) }

//------------------------------
Static Func SelColor( cCODE,cDEL,dEXP,dDEL,cTYPE )

LOCAL nCOLOR := CLR_BLACK

IF EMPTY(dEXP)
dEXP := CTOD("00/00/00")
ENDIF

IF EMPTY(dDEL)
dDEL := CTOD("00/00/00")
ENDIF

DO CASE
CASE cTYPE = 'F'

IF cDEL <> " " .and. dDEL = CTOD("00/00/00")
nCOLOR := CLR_WHITE // red
ELSE
nCOLOR := CLR_BLACK
ENDIF

CASE cTYPE = 'B'

DO CASE
CASE dEXP < DATE() .and. dDEL = CTOD("00/00'00")
nCOLOR := RGB(255,255,0) // yellow

CASE cCODE <> "98" .and. cCODE <> " " .and.;
cCODE <> "**"
nCOLOR := RGB(255,128,0) // orange

CASE cDEL <> " " .and. dDEL = CTOD("00/00/00")
nCOLOR := RGB(192,3,51) // red

OTHERWISE
nCOLOR := CLR_WHITE
ENDCASE


ENDCASE

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

Postby Manuel Valdenebro » Sun Dec 30, 2007 9:06 pm

nageswaragunupudi wrote:Please try
Code: Select all  Expand view  RUN
oLbx:nClrPane:={|| IIF(oRs:AbsolutePosition % 2==0,CLR_LGREEN,CLR_LGRAY)}


Thank very much Nageswara. Now all it is ok.
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Postby hua » Mon Dec 31, 2007 7:23 am

Rick Lipkin wrote:
I wrote a thread on the subject with samples:

http://fivetechsoft.com/forums/viewtopi ... &highlight



Rick,

I put an entry based on your ADO article in the wiki at this section
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Postby Manuel Valdenebro » Mon Dec 31, 2007 5:54 pm

Rick Lipkin wrote:Manuel

Try this code based on a specific fields in your table .. the colors are based on dates in each row..


Rick thanks.

I had seen now we are seven FW-Oracle ( You, Metaldrummer (Chile), NageswaRao (India), tnhoe (Malasya), BielEA6DD, Baxajaun and I from Spain. I believe we must work together to develope this marvellous tools, (now free in Express version) and help new friends would like to work with FW + Oracle.

Happy New Year.
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Postby Rick Lipkin » Mon Dec 31, 2007 6:03 pm

Manuel

Good luck with Oracle .. you need to have an installed Client for Oracle for msdora and or oraoledb .. not native to Windows OS like Sql server.

Haven't had much luck in that areana. I am running Vista and the Ora9i cd's I use have a compatability alert when I try to install the setup ..

I kinda gave up on Oracle and ADO for now .. if you have any luck or can point me in the direction to a 'vista' compatable Oracle client .. please let me know.

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

Postby nageswaragunupudi » Tue Jan 01, 2008 4:42 am

Friends

I would be happy to share my experiences in working with Oracle. Likewise I like to be benefited by others experiences as well. My involvement with Oracle is not limited to just using ADO, but includes PL/SQL, making Oracle packages and interfacing them with ADO.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Manuel Valdenebro » Tue Jan 01, 2008 6:27 pm

nageswaragunupudi wrote:Friends

I would be happy to share my experiences in working with Oracle.


Thanks Nageswara.

Actually, I am using oRecordSet:Find() successfully in a browse, but when I try to use oRecordSet:Filter I received an error.

Do you know if we can use oRs:FILTER with ADO/ORACLE?

On next 8th January, I will begin a PL course. I hope interchange experiences with you.

Regards
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Postby nageswaragunupudi » Wed Jan 02, 2008 12:01 am

These are some examples

oRs:Filter := 'COUNTRY LIKE 'IT%'
oRs:Filter := 'AMOUNT > 1000'
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Rick Lipkin » Wed Jan 02, 2008 12:39 am

Just a quick note here .. don't forget to clear your filters like this

oRs:Filter := ""

Clearing the filter will re-set the recorset and give you back access to your origional 'fetch'

oRs:Requery() is a useful tool as well as oRs:ReSync(1,2) .. do not leave the resync parameters out .. and you MUST have a 'primary key' set on your table for the Resync method to work.

ReSync is a must in a networked environment especially for workstation update visability... if you use local recordsets ( which I recommend )

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

Postby Manuel Valdenebro » Wed Jan 02, 2008 4:36 am

nageswaragunupudi wrote:These are some examples

oRs:Filter := 'COUNTRY LIKE 'IT%'
oRs:Filter := 'AMOUNT > 1000'


Thanks Nageswara. Now all it is ok.

Regards
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests