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

I get an error Runtime Error "3265" Item cann't be found

Status
Not open for further replies.

odessa79

Programmer
Sep 16, 2003
31
US
Anybody has a suggestion?

Set cmd = New ADODB.Command

With cmd
.ActiveConnection = cn400
.CommandText = "SELECT max(PRJNBR) FROM ENPRAWD02.PRJPF"
.CommandType = adCmdText

Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseServer
objRecordset.Open cmd, , adOpenForwardOnly, adLockReadOnly

With objRecordset
Set wrkProjectNumber = .Fields("PRJNBR") It kick an error on this line
End With
End With


Thanks
 
set the columnName of the return value:

.CommandText = "SELECT max(PRJNBR) [red]as PRJNBR[/red] FROM ENPRAWD02.PRJPF"


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
>SELECT max(PRJNBR)
If you run this in query analyser you will see (no column header) displayes . . .

SELECT max(PRJNBR) as 'PRJNBR'
[flowerface]

I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
 
instead of aliasing the column you could also just:

wrkProjectNumber = .Fields(0).value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top