|
-
Mar 5th, 2001, 09:28 PM
#1
Thread Starter
Lively Member
I'm working with VB6 into a SQL Server 7 database. I've been using this code to open recordsets:
Code:
Set objCmd = New ADODB.Command
objCmd.ActiveConnection = PROJ_DB
objCmd.CommandType = adCmdStoredProc
With objCmd
.CommandText = "sel_candidate_where_candno_ordered"
.Parameters.Refresh
.Parameters(1) = txtSeek
Set rsCand = .Execute
End With
Set objCmd = Nothing
The problem is, it doesn't allow for bookmarks, so populating grids, etc. are problems. There must be a way to open it as a Keyset using adOpenKeyset, such as:
Code:
rsCand.CursorType = adOpenKeyset
Can anyone help me out?? Thanks...
-
Mar 6th, 2001, 09:50 AM
#2
You're on the right track...
Add this to the end of the execute statement
Set rsCand = .Execute(,,adOpenKeyset )
-
Mar 6th, 2001, 10:13 AM
#3
Thread Starter
Lively Member
Hey Bubba:
Well, I tried it, but got the following error:
"Procedure 'sel_candidate_where_candno_ordered' expects parameter @Parm1, which was not supplied"
I think one of the commas expects parameters. Without anything there, it wipes out the Parameter(1) value. I suppose I could put a value in there, but there are other calls which require 10-20 parameters.
-
Mar 6th, 2001, 10:24 AM
#4
How 'bout this?
[code]
Set objCmd = New ADODB.Command
objCmd.ActiveConnection = PROJ_DB
objCmd.CommandType = adCmdStoredProc
With objCmd
.CommandText = "sel_candidate_where_candno_ordered"
.Parameters.Refresh
.Parameters(1) = txtSeek
.Open
End With
rsCand.Open objCmd, ,adOpenKeyset, adLockReadOnly
Set objCmd = Nothing
-
Mar 6th, 2001, 11:16 AM
#5
Thread Starter
Lively Member
Hey Bubba:
Thanks for ll your help.
Open is not a valid method for the Command object.
Jeff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|