Thread: Late Binding
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Cindy Cindy is offline
external usenet poster
 
Posts: 10
Default Late Binding

Thanks Jake

It works! Also, thanks for the tip on declaring
variables. I thought when you separated by a comma on the
same line they would all be declared as that type.

Have a great day
-----Original Message-----
Hi Cindy,

Cindy wrote:
I switched my references over as you stated but I have a
compile error on the last line of this code, at
adOpenKeyset, adLockOptimistic, adCmdTable.


Please reread #1 in my original reply. <g Or use the

values Chip provided.

'Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim cn, rs As Object


Just a comment here. When you are declaring variables

(whether they be
"normal" variables or object variables), you should

always explicitly
declare them. In this case, cn is being declared as a

Variant because you
didn't use "As Object" for it. Only rs gets declared as

an Object. In this
case, it doesn't make much difference (as either Variant

or Object will work
here), but doing this can cause unexpected results.

That's why I typically
declare each variable on a separate line.

Other than that, your new code looks good and should work

as it did when
early bound.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address

unmonitored]

.