Guidance
指路人
g.yi.org
software / rapidq / Examples / Database / using dbf / testdb.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'$include "RapidQ.inc"
     CONST fmCreate = 65535
     CONST fmOpenRead = 0
     CONST fmOpenWrite = 1
     CONST fmOpenReadWrite = 2

'-- Offsets
     CONST soFromBeginning = 0       '-- Seek (offset) from Beginning
     CONST soFromCurrent = 1         '-- Seek (offset) from Current position
     CONST soFromEnd = 2             '-- Seek (offset) from End

     CONST False =     0
     CONST True  =     1

     $INCLUDE "d:\rqdbase\dbt.inc"
     $INCLUDE "d:\rqdbase\dbase.inc"


'BEGIN
     tablename$ = "d:\rqdbase\mymemos.dbf"

'struinfo("_date","D",8,0)
'struinfo("notas","M",10,0)
'if dbcreate(tablename$) then
'else
'  print "Table cannot be created.. in application"
'  END
'end if

     dbopen(tablename$, fmOpenReadWrite)
'dbZap           'Empty the table (wipes out data..)
'dbAppend        'Create a new (empty) record

'fieldput(1, DATE$, 0)
'fieldput(2, string$(500, "0"), FORCE_UPDATE)   'Only with memos

'fieldput(1, "01/01/1990", 0)
'fieldput(2, string$(600, "a"), -1)

     WHILE NOT eof()
      PRINT fieldget(1)
      PRINT fieldget(2)
      PRINT

      PRINT recno()
      dbskip(1)
     WEND

     dbgoto(1)
     PRINT fieldget(1)
     PRINT fieldget(2)
     PRINT "Current record   "; recno()


'print "# of fields.. "; fcount()
'print "Structure list.."
'for i = 1 to fcount()
' name$ = fieldname(i)
' print name$; "  "; typeOf(i); "  "; lengthOf(i); "  ";decimalsOf(i)
'next
     dbclose

掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sun 2023-1-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:43:52