Question about SQL

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

Post by vailtom »

Vailton Renato
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Post by cdmmaui »

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
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Please try

Code: Select all

oLbx:nClrPane:={|| IIF(oRs:AbsolutePisition % 2==0,CLR_LGREEN,CLR_LGRAY)}
Regards

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

Post by nageswaragunupudi »

Sorry
AbsolutePosition
not
AbsolutePisition

Sorry for the spelling mistake
Regards

G. N. Rao.
Hyderabad, India
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

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
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

nageswaragunupudi wrote:Please try

Code: Select all

oLbx:nClrPane:={|| IIF(oRs:AbsolutePosition % 2==0,CLR_LGREEN,CLR_LGRAY)}
Thank very much Nageswara. Now all it is ok.
Un saludo

Manuel
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Post by hua »

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
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

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

Post by Rick Lipkin »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

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
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

These are some examples

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

G. N. Rao.
Hyderabad, India
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

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
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

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
Post Reply