VBA, Oracle and Access (1 Viewer)

bastien

New member
Local time
Today, 21:52
Joined
Feb 26, 2002
Messages
7
Hi


So I wrote the code below and when it attempts to execute the connection / sql, it takes forever. The rendering tothe screen stops and the form doesn't even show. What causes this to take so long? The query itself is very quick when run through TOAD. So it's gotta be the connection. Through the UDL file the test connection works fine and it's quick. Any ideas????

connString = "'Provider=MSDAORA.1;User ID=*****;Persist Security Info=False;Data Source=" & strServer & "'"

Me.LblAlert.Caption = connString
cn.ConnectionString = connString
cn.Open connString

strSQL = "select count(distinct(person_id)) from cme_person a, dce_net_balances_table b where "
strSQL = strSQL & " a.client_id = " & strClientCode & " and a.client_id = b.client_code "
strSQL = strSQL & " and (b.cont_securities+b.other_securities)>0"

MsgBox strSQL

rs.ActiveConnection = cn
rs.Open strSQL

Me.[Number of lives].Value = rs(0).Value

cn.Close
rs.Close
Set cn = Nothing
Set rs = Nothing

thanks
 

Users who are viewing this thread

Top Bottom