Re: Freeze in ADODB.Recordset.Open
From: Val Mazur (group51a_at_hotmail.com)
Date: 05/21/04
- Next message: --CELKO--: "Re: Newbie question: Fill dataset will ALL tables from database"
- Previous message: Val Mazur: "Re: What MDAC Verison"
- Next in thread: Stephen Howe: "Re: Freeze in ADODB.Recordset.Open"
- Maybe reply: Stephen Howe: "Re: Freeze in ADODB.Recordset.Open"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 22:25:45 -0400
Hi Jonathan,
I do not see any reason for this. Since it does not happen on all PCs, could
be that MDAC installation is corrupted. Try to run Component Checker utility
, which ships with MDAC to see if it is OK
. Other suggestions:
1. Use Set statement to point to the opened connection. If you do not do
this, then recordset will open new connection each time, when you open it
Set .ActiveConnection = glbConn
2. Use OLEDB provider for SQL Server, rather than OLEDB for ODBC. It would
improve performance
-- Val Mazur Microsoft MVP "Jonathan Rynd" <q7a3ofvtcm502@atsneakemail.com.invalid> wrote in message news:Xns94EFB77257CE6jrr7hotmailcom@207.46.248.16... > In VBA (Excel), connecting to MS SQL Server > > We have some code that creates an ADODB recordset. We set > > Public glbConn As ADODB.Connection > > > Set glbConn = New ADODB.Connection > glbConn.Provider = "MSDASQL" > strConn = "DSN=" & kDBKMDSN & ";UID=" & kDBKMUser & ";PWD=" & _ > kDBKMPass & ";" > glbConn.ConnectionString = strConn > glbConn.Open > > Set mRS = New ADODB.Recordset > With mRS > .CursorType = adOpenStatic > .LockType = adLockReadOnly > .ActiveConnection = glbConn > End With > > and then in a loop we call > > With mRS > .Source = strSQL > .Open > ' more stuff > .Close > End With > > The problem is that, on some computers but not others, the call to .Open > hangs -- it takes forever. The only way to recover is to break the > program (ctrl-break or esc), click debug, and then press F5. That makes > things start working again. Without doing that it hangs forever. > > This hang does not take place when the code is stepped through using F8. > > - How can I diagnose this? What other information would be helpful?
- Next message: --CELKO--: "Re: Newbie question: Fill dataset will ALL tables from database"
- Previous message: Val Mazur: "Re: What MDAC Verison"
- Next in thread: Stephen Howe: "Re: Freeze in ADODB.Recordset.Open"
- Maybe reply: Stephen Howe: "Re: Freeze in ADODB.Recordset.Open"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|