Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close database connection?

Status
Not open for further replies.

Sajtz

IS-IT--Management
Apr 23, 2002
75
EU
Hi. Got another problem boys & girls.

This time my connection to the Access database won´t close. I´ve tried everything..but nothing. The .swf and the dllhost.exe consumes all of my CPU and I have no clue what to do.

This is my .asp file:

<%
Set DataConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
DataConn.Open &quot;Driver=Microsoft Access Driver (*.mdb);DBQ=&quot; & Server.MapPath(&quot;Status.mdb&quot;)

Set cmdTemp = Server.CreateObject(&quot;ADODB.Command&quot;)
Set rstContacts = Server.CreateObject(&quot;ADODB.Recordset&quot;)
cmdTemp.CommandText = &quot;Select Status From users&quot;
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn

rstContacts.Open cmdTemp, , 1, 3
rstContacts.Move CLng(Request(&quot;Record&quot;))
Response.write &quot;Status=&quot; & Server.URLEncode(rstContacts(&quot;Status&quot;))
rstContacts.Close
DataConn.Close
set rstContacts = Nothing
set DataConn = Nothing
%>

And that shouldn´t be any major problems.

This is my flash-call:


onClipEvent (enterFrame) {
loadVariables(&quot; , this);
if (Status == &quot;False&quot;) {
this._visible = true;
} else {
this._visible = false;
}
}
 
if thats a one frame movieclip calling the asp page then thats the problem. its calling it over and over.
if that is the case then think about moving the code onto the main timeline so its only called when needed and not time and again.
 
Thnxs for your reply.

I´ve thought about that, but the problem is that &quot;onClipEvent&quot; requieres a movieclip. And the moviclip is only created to please this demand. (the single frame movieclip only contains a button)

:(
 
well thats your problem ......it calling the asp page every time it enters the frame....so if your fps is 15 then thats 15 calls a second.

if you are using then mx then use loadvars and put the code on the main timeline.
 
hm. Never used Loadvars..and this bad try didn´t work:



myLoadVars.load(&quot;if (Status == &quot;False&quot;) {
ledig1._visible = true;
} else {
ledig1._visible = false;
}


Where ledig1 is the instance name of the button.

Seems like &quot;Status == &quot;False&quot;&quot; never seems to occour.
 
Bill, that worked perfectly!

Thnxs alot m8. Guys like you are worth your weight in Gold :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top