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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could not use ''; file already in use.

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
Wait wait before you answer....
I know this isn't a permission error!
I have been able to access this particular page before.
I use an include to specify the database connection:
<%
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.Open &quot;PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=e:\path\to\my.mdb&quot;
%>
The error occurs on the conn.open line. Because of the directory structure, I have to use two copies of this include.
The pages in the folder with the original include *all work fine*. This page however (the only page in a different folder), is causing this error. I tried renaming the include file, but I still get the error.

Any ideas?
 
Hmmmm.... and only this one doesn't work?

You say &quot;because of the directory structure&quot;... does that mean depending on where you call it, the path is different??

Try just replacing the absolute path in the one that works with:

server.mapPath(virtualPathToTheDB)

and then just using that one from all scripts...

Or did I miss your point?
penny.gif
penny.gif
 
I've got the exact same problem! My difference is that when I hard code my SQL statement the script runs fine, when I have it generate the code, the script give me the above mentioned error!!! Any suggestions?

Here is my script that generates my SQL statement:
<%
set strQuestion = New DynamicArray
set strAnswer = New DynamicArray

'Response.Write(Request.Form&&quot;<br>&quot;)

SQL=&quot;SELECT * FROM QUESTION;&quot;
RunQuery(SQL)

'question counter
i=1

do while not RS.EOF
strQuestion.data(i)=RS.fields(&quot;question&quot;)
strAnswer.data(i)=Request.form
(strQuestion.data(i))
i=i+1
RS.MoveNext
loop

'CloseDB()

SQL=&quot;INSERT INTO SURVEY_RESULTS (&quot;

for q = strQuestion.startIndex()+1 to
strQuestion.stopIndex()
if q = strQuestion.stopIndex() then
SQL=SQL & strQuestion.data(q)
else
SQL=SQL & strQuestion.data(q) &&quot;, &quot;
end if
next

SQL=SQL & &quot;) VALUES (&quot;

for a = strAnswer.startIndex()+1 to
strAnswer.stopIndex()
if a = strAnswer.stopIndex() then
SQL=SQL & &quot;'&quot; & strAnswer.data(a) & &quot;'&quot;
else
SQL=SQL & &quot;'&quot; & strAnswer.data(a) & &quot;',&quot;
end if
next

SQL=SQL & &quot;)&quot;

Response.write(SQL)

RunQuery(SQL)
%>

Here is the hardcoded SQL statement and script executes just fine. I copied and pasted the SQL statement the original script generated right before it errored out on me.
<%
SQL=&quot;INSERT INTO SURVEY_RESULTS (bus_type,
gen_type, com_type, bus_size, it_emply, it_dev, it_pack,
it_out, exper, job_titl, job_othr, skil_a01, skil_aa01,
skil_a02, skil_aa02, skil_a03, skil_aa03, skil_a04,
skil_aa04, skil_a05, skil_aa05, skil_a06, skil_aa06,
skil_a07, skil_aa07, skil_a08, skil_aa08, skil_b01,
skil_bb01, skil_b02, skil_bb02, skil_b03, skil_bb03,
skil_b04, skil_bb04, skil_b05, skil_bb05, skil_b06,
skil_bb06, skil_b07, skil_bb07, skil_b08, skil_bb08,
skil_b09, skil_bb09, skil_b010, skil_bb010, skil_b011,
skil_bb011, skil_c01, skil_cc01, skil_c02, skil_cc02,
skil_c03, skil_cc03, skil_c04, skil_cc04, skil_c05,
skil_cc05, skil_c06, skil_cc06, skil_c07, skil_cc07,
skil_c08, skil_cc08, skil_c09, skil_cc09, skil_c010,
skil_cc010, skil_c011, skil_cc011, skil_c012, skil_cc012,
skil_c013, skil_cc013, skil_c014, skil_cc014, skil_c015,
skil_cc015, skil_d01, skil_dd01, skil_d02, skil_dd02,
skil_d03, skil_dd03, skil_d04, skil_dd04, skil_d05,
skil_dd05, skil_d06, skil_dd06, skil_d07, skil_dd07,
skil_d08, skil_dd08, skil_d09, skil_dd09, skil_e01,
skil_ee01, skil_e02, skil_ee02, skil_e03, skil_ee03,
skil_e04, skil_ee04, skil_e05, skil_ee05, skil_e06,
skil_ee06, skil_e07, skil_ee07, skil_e08, skil_ee08,
skil_e09, skil_ee09, skil_f01, skil_ff01, skil_f02,
skil_ff02, skil_f03, skil_ff03, skil_f04, skil_ff04,
skil_g01, skil_gg01, skil_g02, skil_gg02, skil_g03,
skil_gg03, skil_g04, skil_gg04, skil_g05, skil_gg05,
skil_h01, skil_hh01, skil_h02, skil_hh02, skil_h03,
skil_hh03, skil_h04, skil_hh04, skil_h05, skil_hh05,
skil_i01, skil_ii01, skil_i02, skil_ii02, skil_j03,
skil_jj03, skil_k01, skil_kk01, skil_k02, skil_kk02,
skil_k03, skil_kk03, skil_k04, skil_kk04, skil_k05,
skil_kk05, skil_l01, skil_ll01, skil_l02, skil_ll02,
skil_l03, skil_ll03, skil_l04, skil_ll04, skil_l05,
skil_ll05, skil_m01, skil_mm01, skil_m02, skil_mm02,
skil_m03, skil_mm03, skil_m04, skil_mm04, skil_n01,
skil_nn01, skil_n02, skil_nn02, skil_n03, skil_nn03,
skil_n04, skil_nn04, skil_n05, skil_nn05, skil_n06,
skil_nn06, skil_n07, skil_nn07, skil_n08, skil_nn08,
skil_n09, skil_nn09, skil_n010, skil_nn010, skil_o01,
skil_oo01, skil_o02, skil_oo02, skil_o03, skil_oo03,
skil_o04, skil_oo04, skil_o05, skil_oo05, drawing, name,
address, phone, mail, skil_p01, skil_pp01, skil_p02,
skil_pp02, skil_p03, skil_pp03, skil_p04, skil_pp04) VALUES
('8','','','1','2','1','1','1','7','18','','2','1','2','2','
2','2','1','4','5','2','3','3','1','1','5','5','3','1','2','
3','5','4','2','3','1','1','5','5','5','4','1','3','3','5','
4','1','2','3','3','1','5','4','4','2','3','3','3','1','2','
5','4','1','2','3','1','1','5','1','3','1','1','2','3','4','
4','2','3','1','1','2','2','1','1','1','2','2','3','2','5','
5','5','1','1','3','3','5','4','4','1','1','5','5','3','3','
3','3','3','1','1','5','5','3','3','3','5','2','4','5','4','
4','5','5','1','1','5','5','3','3','3','1','2','5','4','4','
3','1','2','4','4','3','4','3','3','2','2','2','1','1','3','
5','1','1','1','3','2','2','4','4','2','3','3','1','2','2','
1','1','5','1','3','1','1','2','3','2,
1','2','','1','5','3','3','1','1','5','2','2','3','2','3','4
','4','5','2','3','1','3','1','5','2','3','2','1','1','2','3
','5','4','1','Ludwig Possie','963 W 4100 S, Riverdale, UT
84405','804-773-
4736','possie@peoplepc.com','3','3','1','3','2','1','4','5')
&quot;

RunQuery(SQL)
%>
 
Not trying to insult your intelegence(I cant even spell well) but make sure your database is not open when the script runs. You also mentioned something about using two includes. Make sure that in your processing the connection isnt trying to be opened twice. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top