View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Eric Fung Eric Fung is offline
external usenet poster
 
Posts: 2
Default Can DB connection retain throughout the Excel working session ?

Dear all,

I am novice to programming in Excel.

I want to know, if possible, how to let an Excel user open a connection to a
DB server (e.g. SQL server)
and then lets all operation for the user to work with that connection,
and close the connection only when the user exit Excel.

This is what I expect from an old fashion client server program.

I've seen code sample of ADO in Excel VBA,
to open a connection, perform DB operation, and then close connection.
however, as the series of operation is done within the scope of a subroutine
for a particular event,
every such event will cause a new connection on the DB server.

I don't want to carry out logon / logoff on the SQL Server repetitively,
to minmize the extra burden on SQL server.

Is my way of thoughts OK? Can it be done ?

Thanks in advance for anyone's kind help ...
Eric