Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle Objects for OLE: Connection Question.
Yes. Make the declarations global and don't reset the connection to nothing
when you are done. When the form opens up create your dynaset. When the
timer object fires every 5 seconds do a
dynset1.dbrefresh(). That way it will just reexecute the query and not
reparse etc.(should be a lot faster) Otherwise you are beating the
daylights out of the CPU on the database machine.
Jim
"LF" <lvflcv_at_rcn.com> wrote in message news:8t2mr8$42g$1_at_bob.news.rcn.net...
> Greetings All, I have a small app that consists of a single form with a
> timer
> objects that wakes up every 5 seconds and queries the database for the
> number
> of connections. Currently everything works fine, inside the timer object
> I have something like:
>
>
> Dim OraSession As OraSession
> Dim OraDatabase As OraDatabase
> Dim dynSet1 As OraDynaset
>
> Set OraSession = CreateObject("OracleInProcServer.XOraSession")
> Set OraDatabase = OraSession.OpenDatabase("db", "u/p", 1&)
>
> Set dynset1 = OraDatabase.CreateDynaset("select count(*) from
v$session",
> ORADYN_READONLY)
>
> lblLbl.Caption = dynSet1.Fields(0).Value
>
> Set OraSession = Nothing
> Set OraDatabase = Nothing
>
>
> With what I have the connection to the database has to be made each time
> the timer wakes up. What I woul like to do is to set the connection
string
> one time only, say on form load, and then reference that connections from
> the timer. Is this possible?
>
> I would appreciate any help regarding this problem.
>
>
Received on Mon Oct 23 2000 - 20:08:17 CDT
![]() |
![]() |