27 Jun 2016 21:10
USE net:example.org:2942:path/to/file
netio_ProcExec( "example.org:2942:procname" )
or using UNC paths:
USE net://example.org:2942/path/to/file
netio_ProcExec( "//example.org:2942/procname" )
It's also possible to specify the password. The connection string
is in format:
<server>[:<port>[:<passwd>]]:<filepath|funcname>
or:
//<server>:<port>:<passwd>:<filepath|funcname>
or:
//<server>[:<port>]/<filepath|funcname>
Backslashes '\' are also supported and can be used instead of '/'.
Password is always terminated by ":" and whole connection string
is terminated by Chr(0) so it's not possible to use these two
characters as part of password. Anyhow when passwords are required
then it's recommended to open the connection by netio_Connect()
and then specify only server and port if server is not unique
enough to chose from existing connections. If server is not
given then default connection is chosen.
30 Out 2018 16:43
30 Out 2018 17:56
rubens escreveu:O Post é antigo, mas...
ASimoes, ainda está usando Netio?
Vi um exemplo na HMGs e parece bem simples...
Rubens
31 Out 2018 06:57
31 Out 2018 07:47
LETO_BEGINTRANSACTION( [ [ lUnlockAll ] )
LETO_ROLLBACK( [ lUnlockAll ] ) ==> nil
LETO_COMMITTRANSACTION( [ lUnlockAll ] ) ==> lSuccess
LETO_INTRANSACTION() ==> lTransactionActive
4.4 Samba file service
If files served by a Samba server to its clients need to be shared with a LetoDBf server,
LetoDBf must be special configured.
31 Out 2018 08:53
31 Out 2018 09:13
rubens escreveu:O netio na distribuição do Minigui Extends é só compilar e rodar.. .
31 Out 2018 09:29
Não consigo compilar as libs, apresenta um monte de erros,
Net alguma coisa, tento a rodar a linha aqui e dá erro.
Depende de vc, do seu conhecimento sobre serviços do windows.beleza vou lá nos serviços ele está lá. Só isso?
tasklist -> lista processos
net start, net stop. Ativar e desativar serviços, isso no Windows no Linux são outros comandos.
E o comando sc que remove(apaga) o serviço do letodb[f]
sc delete letodbf_service.
letodb.exe e o letodb.ini
e a lib librddleto.a que vc linka com sua aplicação.
Apenas esses 3 arquivos.
/*
* This sample tests working with dbf files
* Just change the cPath value to that one you need.
*/
REQUEST LETO
REQUEST DBFCDX
#include "dbinfo.ch"
Function Main( cPath )
LOCAL aNames := { "Petr", "Ivan", "Alexander", "Pavel", "Alexey", "Elch", ;
"Konstantin", "Vladimir", "Nikolay", "Andrey", "Dmitry", "Sergey" }
LOCAL i, aStru, aServerDriver
LOCAL nPort := 2812
FIELD NAME, NUM, INFO, DINFO, MINFO, TINFO
ALTD()
SET DATE FORMAT "dd/mm/yy"
IF Empty( cPath )
//cPath := "//127.0.0.1:2812/"
cPath := ""
RDDSETDEFAULT( "DBFCDX" )
ELSE
cPath := "//" + cPath + IiF( ":" $ cPath, "", ":" + ALLTRIM( STR( nPort ) ) )
cPath += Iif( Right(cPath,1) == "/", "", "/" )
RDDSETDEFAULT( "LETO" )
ENDIF
IF dbCreate( cPath + "test1", { { "NAME", "C", 10, 0 },;
{ "NUM" , "N", 4, 0 },;
{ "INFO", "C", 32, 0 },;
{ "DINFO", "D", 8, 0 },;
{ "TINFO", "@", 8, 0 },;
{ "MINFO", "M", 10, 0 } } )
? "File has been created"
ENDIF
USE ( cPath + "test1" ) NEW
IF ! NetErr() .AND. ! EMPTY( ALIAS() )
? "File has been opened"
ELSE
? "ERROR opening database! -- press any key to quit"
Inkey( 0 )
QUIT
ENDIF
aStru := dbStruct()
? "Fields:", Len( aStru )
FOR i := 1 TO Len( aStru )
? i, aStru[i,1], aStru[i,2], aStru[i,3], aStru[i,4]
NEXT
FOR i := 1 TO Len( aNames )
APPEND BLANK
REPLACE NAME WITH aNames[ i ],;
NUM WITH i + 1000,;
INFO WITH "This is a record number " + Ltrim( Str( i ) ),;
DINFO WITH Date() + i - 1,;
MINFO WITH aNames[ i ]
#ifndef __XHARBOUR__
REPLACE TINFO WITH IIF( i == 6, HB_STRTOTS( "" ), hb_DToT( DATE() + i, TIME() ) )
#else
REPLACE TINFO WITH IIF( i == 6, STOT( "00000000000000.000" ),;
STOT( DTOS( DATE() + i ) + LEFT( TIME(), 2 ) + SUBSTR( TIME(),4,2) + RIGHT(TIME(),2) + ".321" ) )
#endif
NEXT
? LEN( aNames ), "Records has been added"
INDEX ON NAME TAG NAME
? "INDEX KEY 1:", indexkey( 1 )
INDEX ON STR( NUM, 4 ) TAG NUM
? "INDEX KEY 2:", indexkey( 2 )
INDEX ON TINFO TAG TS
? "INDEX KEY 3:", indexkey( 3 )
INDEX ON INFO TAG ASH
? "INDEX KEY 3:", indexkey( 4 )
? "File has been indexed, "
?? DBORDERINFO( DBOI_ORDERCOUNT )
?? " active orders "
?? Iif( DBORDERINFO( DBOI_ORDERCOUNT ) == 4, "- Ok","- Failure" )
?
? "Press any key to continue..."
Inkey( 0 )
i := RecCount()
? "Reccount ", i, Iif( i == Len( aNames ), "- Ok","- Failure" )
DbSetOrder( 0 )
GO TOP
? "go top ", NUM, NAME, DINFO, Iif( NUM == 1001, "- Ok","- Failure" )
REPLACE INFO WITH "First", MINFO WITH "First"
DbGoTo( 5 )
REPLACE INFO WITH ""
GO BOTTOM
? "go bottom", NUM, NAME, DINFO, Iif( NUM == 1012, "- Ok","- Failure" )
REPLACE INFO WITH "Last", MINFO WITH "Last"
?
? 'ordSetFocus( "NAME" )'
ordSetFocus( "NAME" )
GO TOP
? "go top ", NUM, NAME, DINFO, Iif( NUM == 1003, "- Ok","- Failure" )
SKIP
? "skip ", NUM, NAME, DINFO, Iif( NUM == 1005, "- Ok","- Failure" )
GO BOTTOM
? "go bottom", NUM, NAME, DINFO, Iif( NUM == 1008, "- Ok","- Failure" )
SKIP -1
? "skip -1 ", NUM, NAME, DINFO, Iif( NUM == 1012, "- Ok","- Failure" )
DbSetOrder( 4 )
DBGOBOTTOM()
DBSEEK( "", .T. )
? "DbSeek( '',.T. ) ", NUM, NAME, DINFO, Iif( NUM == 1005, "- Ok","- Failure" )
DbSetOrder( 1 )
DBGOBOTTOM()
DBSEEK( "Petr", .F. )
? "DbSeek( 'Petr',.F. ) ", NUM, NAME, DINFO, Iif( NUM == 1001, "- Ok","- Failure" )
DBGOBOTTOM()
DBSEEK( "Petr", .T. )
? "DbSeek( 'Petr',.F. ) ", NUM, NAME, DINFO, Iif( NUM == 1001, "- Ok","- Failure" )
DBGOBOTTOM()
DBSEEK( "Pe", .T. )
? "DbSeek( 'Pe',.T. ) ", NUM, NAME, DINFO, Iif( NUM == 1001, "- Ok","- Failure" )
DbSetOrder( 3 )
DBGOBOTTOM()
#ifndef __XHARBOUR__
DBSeek( hb_DToT( DATE() + 5 ), .T. )
#else
DBSeek( STOT( DTOS( DATE() + 5 ) + "000000.000" ), .T. )
#endif
? "DbSeek( TS,.T. ) ", NUM, NAME, DINFO, Iif( NUM == 1005, "- Ok","- Failure" )
DBGOBOTTOM()
#ifndef __XHARBOUR__
DBSeek( hb_DToT( DATE() + 5 ), .F. )
#else
DBSeek( STOT( DTOS( DATE() + 5 ) + "000000.000" ), .F. )
#endif
? "DbSeek( TS,.F. ) ", NUM, NAME, DINFO, Iif( EOF(), "- Ok","- Failure" )
DbSetOrder( 1 )
DBGOTOP()
DBSEEK( "Sergey", .F. )
? "DbSeek( 'Sergey',.F. )", NUM, NAME, DINFO, Iif( NUM == 1012, "- Ok","- Failure" )
DBGOTOP()
DBSEEK( "Ser", .T. )
? "DbSeek( 'Sergey',.T. )", NUM, NAME, DINFO, Iif( NUM == 1012, "- Ok","- Failure" )
DBGOTOP()
DBSEEK( "Sergez", .F. )
? "DbSeek( 'Sergez',.F. )", NUM, NAME, DINFO, Iif( EOF(), "- Ok","- Failure" )
SET FILTER TO NUM >= 1004 .AND. NUM <= 1010
?
? "SET FILTER TO NUM >= 1004 .AND. NUM <= 1010"
GO TOP
? "go top ", NUM, NAME, DINFO, Iif( NUM == 1005, "- Ok","- Failure" )
SKIP
? "skip ", NUM, NAME, DINFO, Iif( NUM == 1010, "- Ok","- Failure" )
GO BOTTOM
? "go bottom", NUM, NAME, DINFO, Iif( NUM == 1008, "- Ok","- Failure" )
SKIP -1
? "skip -1 ", NUM, NAME, DINFO, Iif( NUM == 1004, "- Ok","- Failure" )
? "Press any key to continue..."
Inkey( 0 )
?
? "SET FILTER TO, SET ORDER TO 0"
SET FILTER TO
SET ORDER TO 0
GO TOP
? "First record", Iif( ALLTRIM( INFO ) == "First" .AND. MINFO == "First", "- Ok","- Failure" )
GO BOTTOM
? "Last record ", Iif( ALLTRIM( INFO ) == "Last" .AND. MINFO == "Last", "- Ok","- Failure" )
?
? 'ordSetFocus( "NUM" ), SET SCOPE TO "1009", "1011"'
ordSetFocus( "NUM" )
SET SCOPE TO "1009", "1011"
GO TOP
? "go top", NUM, NAME, DINFO, Iif( NUM == 1009, "- Ok","- Failure" )
SKIP
? "skip ", NUM, NAME, DINFO, Iif( NUM == 1010, "- Ok","- Failure" )
SKIP
? "skip ", NUM, NAME, DINFO, Iif( NUM == 1011, "- Ok","- Failure" )
SKIP
? "skip ", NUM, NAME, DINFO, Iif( Eof(), "- Ok","- Failure" )
dbCloseAll()
?
? "Press any key to continue..."
Inkey( 0 )
IF RDDSETDEFAULT() == "LETO"
aServerDriver := leto_DbDriver()
ENDIF
IF "CDX" $ RDDSETDEFAULT() .OR. ( VALTYPE( aServerDriver ) == "A" .AND. "CDX" $ aServerDriver[ 1 ] )
USE ( cPath + "test1" ) NEW
i := 0
? "auto opened index Tags:"
DO WHILE ! Empty( Ordkey( ++i ) )
? i, ordKey( i )
ENDDO
OrdSetFocus( 3 )
OrdDestroy( "TS" )
? "Indexord after OrdDestroy():", INDEXORD(), IIF( INDEXORD() == 0, " - Ok", " - Failure" )
ENDIF
dbCloseAll()
?
? "dropping test DBF: "
?? Iif( DbDrop( cPath + "test1" ), "- Ok","- Failure" )
?
? "Press any key to finish ..."
Inkey( 0 )
Return Nil
31 Out 2018 10:15