Hi.
I can do a Updatesql and Delete, but no a Select.
cPass := "drslv"
csql := oCon:SELECT(" 'codigo' , 'pass' FROM 'usuario' WHERE 'codigo' = 'cpass' ")
ocon:Execute(csql)
MsgInfo(oCon[corto])
MsgInfo(oCon[pasar])
Thank you.
Select...SQL SOLUCIONADO
-
- Posts: 392
- Joined: Wed Jul 31, 2013 1:14 pm
- Location: Maldonado - Uruguay
- Contact:
Select...SQL SOLUCIONADO
Last edited by D.Fernandez on Sun Nov 29, 2020 4:31 pm, edited 1 time in total.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: Select...SQL
Dario
Several ways you can do this .. both use RecordSets .. Rao has created a set of ADO wrappers in \source\function\AdoFuncs.prg ..
or
Rick Lipkin
Several ways you can do this .. both use RecordSets .. Rao has created a set of ADO wrappers in \source\function\AdoFuncs.prg ..
or
Code: Select all
oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType := 1 // opendkeyset
oRs:CursorLocation := 3 // local cache
oRs:LockType := 3 // lockoportunistic
cSQL := "SELECT [codigo] , [pass] FROM [usuario] WHERE [codigo] = 'cpass' "
TRY
oRs:Open(cSQL,oCon )
CATCH oErr
MsgInfo( "Error in Opening Usuario table" )
RETURN(.F.)
END TRY
xbrowse( oRs )
oRs:Close()
-
- Posts: 392
- Joined: Wed Jul 31, 2013 1:14 pm
- Location: Maldonado - Uruguay
- Contact:
Re: Select...SQL
Rick, thans a lot, but I'm not use recorset.
Only tray to do a Select with WHERE to get the information of this "campos"
Thank you very much.
Only tray to do a Select with WHERE to get the information of this "campos"
Thank you very much.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
-
- Posts: 392
- Joined: Wed Jul 31, 2013 1:14 pm
- Location: Maldonado - Uruguay
- Contact:
Re: Select...SQL SOLUCIONADO
Gracias Marc.
Asi quedó.
FWCONNECT oCon HOST 'localhost' USER 'root' PASSWORD '' DB dbases
oRs := oCon:RowSet( "select * from usuario where `idusu` = &1", { cUsuario } )
? oRs:FieldGet(4)
Saludos.
Asi quedó.
FWCONNECT oCon HOST 'localhost' USER 'root' PASSWORD '' DB dbases
oRs := oCon:RowSet( "select * from usuario where `idusu` = &1", { cUsuario } )
? oRs:FieldGet(4)
Saludos.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay