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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO, Btrieve, and Indices

Status
Not open for further replies.

sjulian

Programmer
Aug 15, 2000
56
US
I am trying to use seek on a Btrieve table with a two column index. The code I am using follows:
(PPMDSN is a string containing the DSN name, Patient is the table name. key0 is the name of the Btrieve index and it has two columns.)
Code:
Set cnnPPM = New ADODB.Connection
strcnnPPM = "Provider=PervasiveOLEDB;Data Source=" + PPMDSN
cnnPPM.Open strcnnPPM
Set rsC = New ADODB.Recordset
rsC.Open "Patient", cnnPPM, adOpenDynamic, adLockBatchOptimistic, adCmdTableDirect
Dim VariantArray(1) As Variant
VariantArray(0) = "971364825"
VariantArray(1) = "992AAAAA"
rsC.Index = "key0"
rsC.Seek Variantarray, adSeekAfterEQ
After execution, the recordset is at EOF indicating that the matching record was not found. Using the same code with the execption of Dimming the array with one element, works fine on an index with one column, just not with two.

Open to any and all suggestions! Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top