...

View Full Version : Pop-up window, Connection Problem



christrinder
02-27-2003, 11:08 AM
Hello all.

I'm producing a data entry system for my work. The user uses a number of radio boxes to make their selections etc. When they click no, a pop-up window is produced which requests more information. This window uses a connection include file to source data from the database. When they have inputted that, the window closes and they return to the main page. However, if they press no on another radio button too soon after the window closes, then I get the following error. Any ideas?

- - - - - - - - -
Provider error '80004005'

Unspecified error

/dir/conninclude.asp, line 5
- - - - - - - - -


the connection include is as follows...


- - - - - - - - -
<%
dim oConnection
set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath ("db1.mdb")
oConnection.Open
%>
- - - - - - - - -

raf
02-27-2003, 12:34 PM
just a thought;

do you close the connection (after the popup is filled with info from the database ?)

christrinder
02-27-2003, 12:58 PM
At the bottom of the page I have the following code. Not sure if that's all it needs but it doesn't seem to resolve my problem.

<%
oConnection.Close
%>

raf
02-27-2003, 01:18 PM
hmm.

i add a
set oConnection = nothing
to it to free the space it takes. but that probaly wount couse the problem

Are you sure it is placed appropriatly ? i mean if you have somehting like


!!!!warning bad code !!!!!!!

redirect("test.asp")
oConnection.Close


then the connection woun't be closed

christrinder
02-27-2003, 01:29 PM
Bad code? Me? ... Ok, probably! My pop-up window contains a form, you click the submit button, the action is a seperate page, which at the moment, ONLY contains the following code. Any ideas? Please!

<%
set oConnection = nothing
%>

<script language="javascript">
window.close()
</script>

raf
02-27-2003, 02:28 PM
what do you mean ?


which at the moment, ONLY contains the following code. Any ideas? Please!

so you post a form and don't do anythink else then close the window?Why the connection close ?

I meant: close connection+set to nothing in the asp that creates the form (or that processes it and if you open a connection to proces it)
I'm not sure how IIS works with multi-window sessions. I'll take a look in my asp debugging book, but it might not ba an asp problem

I've got some similar things running (open window/generate page/print/close window) and never had a problem with it.

christrinder
02-27-2003, 02:44 PM
Now I have got around to entering all the code and the pop-up window actually does something, it all works fine. Thanks for your help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum