Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Newbie ADODB SEEK question...


Message #1 by Matthew Thompson <thompson@t...> on Thu, 21 Feb 2002 16:44:05 +1000
Hello all,



I want to be able to use the index and seek functionality of ADO, but I  do

not seem to be able to find a combination of options in the open command

that will allow me to do this... I have some sample code below:



/***************************************************************************

****************************************************************************

**********/



var Cnxn = new ActiveXObject("ADODB.Connection");

var strCnxn = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial

Catalog=xyz;Data Source=SQLabc;Integrated Security=SSPI;";

rstTransitionNotes3 = new ActiveXObject("ADODB.RecordSet");



// open connection 

Cnxn.Open(strCnxn) ;



// open recordset using server-side cursor 

rstTransitionNotes3.CursorLocation = adUseServer; 

rstTransitionNotes3.Open("MyTable", strCnxn, adOpenKeyset, adLockReadOnly,

adCmdTableDirect); 



// see if index functionality is supported

if (rstTransitionNotes3.Supports(adIndex)) 

{ 

	rstTransitionNotes3.Index = "PrimaryKey"; 

} 



// clean up 

rstTransitionNotes3.Close; 

Cnxn.Close; 



/***************************************************************************

****************************************************************************

**********/



It does not matter what I do, the rstTransitionNotes3.Supports(adIndex) is

always returned false.



Any help appreciated.



Matt.


  Return to Index