Newbie: From Excel to SQL

V

Vlado

Hi people !

My question is I hope simple. I can't make a simple connection to MS
sql
Server 2K from within Excel to execute an procedure. I have recorded
Macro
to query and put data on sheet. Then I changed statement ( select .. )
to (
exec Myprocedure ) and obtain this:


With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER=SQL Server; SERVER=myServer; UID=myId;
APP=Microsoft
Office XP; WSID=mySid; DATABASE=MyDatabase;
Trusted_Connection=Yes" _
, Destination:=Range("A1"))
.CommandText = Array("exec Myprocedure")


OK. This is working fine. (althouhg I don't need this ADD). The
problem
comes up when this procedure is too long ( >1/2 hour) and Excell is
frozen ('cause he wait to add this data), so I can't do anything untill
the
procedure is finished. Does anybody knows
the code who only send the statement (exec Procedure) to server and
release
excel for other jobs.

any idea appreciated

Regards,
Vlado Kaligari
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top