Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get deleted fields from VFP using SHAPE sql.

Status
Not open for further replies.

arides

IS-IT--Management
Nov 19, 2002
21
AR
im using vba with excel, and using a shape command to get info into a recordset.

the problem is, i'm getting records that are marked as deleted.

that doesn't help with normal queries...

help?

---------------
Arides

Can God write a code so complex he couldn't understand?
 
What is a shape command ?
Does the underlaying table(s) have primary key ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
well, i only stumbled upon the SHAPE recently, but basically it's a way to create hierarchical sql-queries in a different way. here is an example

Code:
dim cnnconn as adodb.connection
dim rs as adodb.recordset

  With cnnConn
        .Provider = "MSDataShape"
        .ConnectionString = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" _
             & strdir & ";Exclusive=No;Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO"
        .Open
    End With


     rs.Open _
             "shape {select cl_codigo, cl_nombre from clientes} AS DATOS " & _
              "append ({select cl_codigo,mo_codigo, mo_monto, ca_cotiz, sum(co_signo*ca_monto) as 'saldo' " & _
              " from cabsdeud group by cl_codigo, mo_codigo, mo_monto, ca_cotiz} as 'cuentas' relate " & _
              " cl_codigo to cl_codigo)" _
             , cnnConn, adOpenStatic, adLockReadOnly
        rs.StayInSync = False

(this is a cut from code, so it won't work if u just paste it)

the shape command is great for bounding them to columns or navigate through this type of queries in a more efficient way; when you are not working with an advanced server like SQL or such.



---------------
Arides

Can God write a code so complex he couldn't understand?
 
FOUND THE SOLUTION! YEPEE

well just browsing within the connection parameters, i found the DELETED parameter, wich accepts YES/NO ; setting wether it will filter out the records marked for deletion.

"NO" will show the deleted records.



---------------
Dogbert

Can God write a code so complex he couldn't understand?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top