Hi,
I'm using excel 2010 - 32 bit version
This is my first of encounters with VBA... supporting an existing application
My VBA code thats creating problem
Source = query that needs to be executed for e.e. "Select Column1 from Table1"
adOpenDynamic = 2
adLockBatchOptimistic = 4
Above VBA code produces this on SQL server profiler, which when executed throws error.
Error details on SQl server
Msg 16955, Level 16, State 2, Line 1
Could not create an acceptable cursor.
Msg 16945, Level 16, State 2, Procedure sp_cursoropen, Line 1 [Batch Start Line 0]
The cursor was not declared.
what should I change the cursor type to so that I can get the ball rolling?
Thanks for the help!
I'm using excel 2010 - 32 bit version
This is my first of encounters with VBA... supporting an existing application
My VBA code thats creating problem
Code:
ADOrst.Open SourceName, GetCurrentConnection(), adOpenDynamic, adLockBatchOptimistic
Source = query that needs to be executed for e.e. "Select Column1 from Table1"
adOpenDynamic = 2
adLockBatchOptimistic = 4
Above VBA code produces this on SQL server profiler, which when executed throws error.
Code:
declare@p1 int
set@p1=0declare@p3 intset@p3=229378declare@p4 intset@p4=294916declare@p5 intset@p5=0
exec sp_cursoropen @p1 output,N'SELECT TOP 100 Column1 from Table1',@p3 output,@p4 output,@p5 outputselect@p1,@p3,@p4,@p5
Error details on SQl server
Msg 16955, Level 16, State 2, Line 1
Could not create an acceptable cursor.
Msg 16945, Level 16, State 2, Procedure sp_cursoropen, Line 1 [Batch Start Line 0]
The cursor was not declared.
what should I change the cursor type to so that I can get the ball rolling?
Thanks for the help!