CopyRec

Method
Copies a record.

Category
Records

 

Syntax
Sub CopyRec(ByVal hTable As Long, ByVal hDstRec As Long, ByVal hSrcRec As Long)

hTable
The handle to the table.

hDstRec
The handle to the record that you want to paste to.

hSrcRec
The handle to the record you want to copy.

 

Example

'Case "CopyRec"

  createTestTable

  fillTestTable (1)

  CF1.OpenTable hTable, .Text1(cf.TableNoCreate).Text

  hRecord = CF1.AllocRec(hTable)

  hRecord2 = CF1.AllocRec(hTable)

  CF1.BWT

  CF1.FindRec hTable, hRecord, "-"

  CF1.CopyRec hTable, hRecord2, hRecord

  tmpVar = "John"

  CF1.AssignField hTable, hRecord2, 1, tmpVar

  CF1.InsertRec hTable, hRecord2

  CF1.EWT

  If CF1.RecCount(hTable) = 2 Then

  logWr "CopyRec OK"

  Else

  logWr "CopyRec failed"

  End

  End If

  CF1.FreeRec hRecord

  CF1.FreeRec hRecord2

  CF1.CloseTable hTable

  deleteTestTable

 

Comments
CopyRec copies the contents of one record to another record. hSrcRec and hDstRec must be handles to records from the same table.



© 2009 Microsoft Corporation. All rights reserved.