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

Seek not working with Ado recordsets and sql server??

Status
Not open for further replies.

1712

Technical User
Nov 8, 2000
66
NL
I have tried everywhich way to get the seek to work but I get a message saying not supported when I open the recordset.

I made sure I was using adcmdtabledirect, and aduseclient, but it still has a problem.

Can anybody enlighten me on what it takes to use seek in vbscript?

Thanks
 
Hello, 1712.

It is known that the SQL Server 6.5 or 7.0 does not support the Seek or Index methods of the Recordset. But, check for newest version and development if implemented or not. Am not following the technology too closely on this.

regards - tsuji

 
Mybe your problem is on the RecordSet Object....
Try these constants and set the properties of the object

Code:
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockPessimistic = 2

set rs=server.CreateObject("ADODB.Recordset")

sub ExecuteSQL(byval cmd)
    if rs.State=1 then rs.Close
    rs.CursorType = adOpenStatic
    rs.CursorLocation = adUseClient
    rs.LockType = adLockPessimistic
    rs.Source = cmd
    rs.ActiveConnection = Connection   'The record set needs to know what connection to use.
    rs.Open
end sub

strSql="select * from tableName"
ExecuteSQL strSql
'now call rs.Seek
________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top