PDA

View Full Version : Question about CursorLocation property.


pupu79
02-16-2003, 07:29 AM
I tried to following statements:

Dim RS
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.CursorLocation = adUseClient

But there was an error reported on the 3rd statement. It said the arguement out of range. I looked up the microsoft document and found that actually CursorLocation is an enum constant. The value of adUseClient is 3. So I put 3 in the last statement instead of adUseClient. Now it works well.

Why? I assume the compiler should know that adUseClient is equal to 3.

bruce
02-17-2003, 11:31 AM
I believe you have to include certain file that include these constants.

[b]quote:Originally posted by pupu79

I tried to following statements:

Dim RS
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.CursorLocation = adUseClient

But there was an error reported on the 3rd statement. It said the arguement out of range. I looked up the microsoft document and found that actually CursorLocation is an enum constant. The value of adUseClient is 3. So I put 3 in the last statement instead of adUseClient. Now it works well.

Why? I assume the compiler should know that adUseClient is equal to 3.
</blockquote id="quote"></font id="quote">

davidseye
02-18-2003, 02:30 AM
What Bruce writes is accurate. You need to include the adovbs.inc file on the page.