I've been asked to look into a issue that we are experiencing relating to locking / blocking whilst running queries in VB6 / ADO to a SQL Server backend. I don't have a lot of SQL Server knowledge, so please forgive me!

I've simplified the issue down to a repeatable sequence of events... I'd like to understand why the blocking occurs and what options are available to resolve it.

Code:
Dim ADOConn As ADODB.Connection
Dim cmd As New ADODB.Command
Dim dbrs As New ADODB.Recordset


Set ADOConn = New ADODB.Connection
ADOConn.ConnectionString = "Provider=SQLOLEDB;Data Source=*****;Initial Catalog=*****;User Id=*****;Password=*****;OLE DB SERVICES=-4"
ADOConn.CursorLocation = adUseClient
ADOConn.Open


ADOConn.Execute "BEGIN TRANSACTION"


With cmd
    .CommandType = adCmdText
    .ActiveConnection = ADOConn
    .CommandText = "CREATE VIEW [SummedBalance] AS Select sum(a_balance) as [Balance] from account"
    .Execute
End With

Set cmd = Nothing


dbrs.Open "Select Balance from SummedBalance", ADOConn, adOpenStatic, adLockOptimistic

....
At the point of running the SELECT statement, everything grinds to a halt. SSMS activity monitor shows a Task state of SUSPENDED and a Wait type of LCK_M_SCH_S against the select statement. It remains in this state until I kill that process, at which point the select statement runs and returns the expected result.

I have been able to get around the blocking in three different ways, but none of them are ideal.
1. Remove the SUM() from the VIEW creation. Not a feasible approach, but why does it work??
2. Remove the BEGIN transaction or moving it to after the VIEW creation. I guess that modifying the schema in a transaction is the base cause, but ideally we need to keep everything together in a transaction. Seems like it should be ok given point 1 above.
3. Change locking to adReadOnly. This prevents the blocking, but isn't suitable for our needs. We also lose access to field properties with this lock type.


Any insight into how to best work with this situation would be greatly appreciated. As mentioned, my SQL Server knowledge is light so there may be something obvious that I'm missing.

Thanks in advance!



As a side note... Above is for example purposes only. The Views that are created are usually far more complex and the entire process can contain several views and multiple update and select steps (Hence why I'd like to keep everything in a transaction).