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!

Error when submitting form - 0x80004005

Status
Not open for further replies.

NewBeginner

Programmer
Nov 12, 2002
12
GB
Firstly i'm a newbie at this kinda thing. So please any help you can give, do so in a step by step process in case i have no idea what you mean!

Ok, here's the problem....
I've been asked by a friend to make a site for their dance troupe, including booking form. I've done what i can so far but now i have a problem. The page is an asp file in VBscript created using dreamweaver mx. I can see the page but when i submit the form i get an error....


Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)'; file already in use.
/haraam/wis.asp, line 113

that section of script is.....

If (CStr(Request(&quot;MM_insert&quot;)) <> &quot;&quot;) Then

' create the sql insert statement
MM_tableValues = &quot;&quot;
MM_dbValues = &quot;&quot;
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),&quot;,&quot;)
MM_delim = MM_typeArray(0)
If (MM_delim = &quot;none&quot;) Then MM_delim = &quot;&quot;
MM_altVal = MM_typeArray(1)
If (MM_altVal = &quot;none&quot;) Then MM_altVal = &quot;&quot;
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = &quot;none&quot;) Then MM_emptyVal = &quot;&quot;
If (MM_formVal = &quot;&quot;) Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> &quot;&quot;) Then
MM_formVal = MM_altVal
ElseIf (MM_delim = &quot;'&quot;) Then ' escape quotes
MM_formVal = &quot;'&quot; & Replace(MM_formVal,&quot;'&quot;,&quot;''&quot;) & &quot;'&quot;
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & &quot;,&quot;
MM_dbValues = MM_dbValues & &quot;,&quot;
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = &quot;insert into &quot; & MM_editTable & &quot; (&quot; & MM_tableValues & &quot;) values (&quot; & MM_dbValues & &quot;)&quot;

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject(&quot;ADODB.Command&quot;)
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> &quot;&quot;) Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>

line 113 is...
MM_editCmd.ActiveConnection = MM_editConnection


As i said i'm a newbie so it's probably something quite easy to solve. But any help you can give will be greatly appreciated.
TIA
 
Make sure that you are using the following sytax to create your connection...

Set objConn = Server.CreateObject( &quot;ADODB.Connection&quot; )
Set objCmd = Server.CreateObject( &quot;ADODB.Command&quot; )
Set objRS = Server.CreateObject( &quot;ADODB.Recordset&quot; )
objConn.Open Application(&quot;connectString&quot;)
Set objCmd.ActiveConnection = objConn
objCmd.CommandTimeout = 300

[laser][yawn] -- Just trying to help... LOL [ponder]
 
OK, I may be being stupid but i can't find that in there anywhere! So i assume i need to put it in, but where do i need to put it, at the start or end, etc?

Thanks for helping me.
 
it sounds like you have a connection open already that was not closed from the error. Is the database being utilized for any other means. Or more to the point do you open a connection in any other page A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
i use the same database in an earlier page, but that has the same problem aswell, but on that page the error is...

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/haraam/Nowi.asp, line 115

I won't post the script aswell but if you want me to i can.

TIA
 
When i say earlier page i mean it will be if i ever get these submitting probs sorted out.
 
You need to emulate it (using your variables) prior to line 113.
Follow these steps:
[ol]
[li]Create connection object - Set MM_editConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
[li]Create command object(which you've done) - Set MM_editCmd = Server.CreateObject(&quot;ADODB.Command&quot;)
[li]Since the stored proc isn't returning anything, you don't need a recordset object
[li]Open the connection - objConn.Open yourConnectionStringGoesHere
[li]set the command object's active connection to your open connection - which you do in line 113
[li]set the command text - which you do in line 114
[li]execute the command - which you do in line 115
[/ol]

try to find some tutorials online (google.com) regarding this, they will explain it better than I do!

-- Just trying to help... LOL [ponder]
 
do you close that connection after the script is done. You need to do that. If it is not you will get exactly what you are getting for a error.

Yes post the INSERT statement. that needs to be fixed as it may be causing the connection to not be closed.

either that or comment out the databse script in the other page to see if that is the solution to the file in use error. That way you trace teh root cause of the error A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
ok i appologise that previous error where i say it's an earlier page isn't it's the different version of the page in the first post. sorry. I will be using that page aswell so i need help there anyway.

The page that will be prior to either of the others comes up with these errors depending on which form i try to proceed to.

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/haraam/prebooking.asp, line 115

Provider (0x80004005)
Unspecified error
/haraam/prebooking.asp, line 113

sorry.

tia

 
mwolf00

ok as i said i'm a newbie.
where you've put yourConnectionStringGoesHere
what would that be? is it just the location of the DB, i.e. c:/blahblahblah, or is it something more?

please be patient. i really REALLY do appreciate you helping.
 
onpnt

do you close that connection after the script is done - how & where?

Yes post the INSERT statement - how & where?

and for the moment i'm still testing it all so what with these problems none of the pages actually link together because i get these probs.

Hey i've an idea why don't i post all the script i've got and let you guys fix it n send it back, that'd be easier, surely. LOL. ;)
 
ya but you don't learn anything that way ;)

ok. Making it easier, the close statements can simply go at the bottom of the page after all the server side code. So just before the </body> tag do this
connection.Close
Set recordset=Nothing
Set i]connection[/i]=Nothing

fill in the naming you have in the italic spaces.


the error you posted earlier stated there was a problem with the SQL statement. If you are not sure what part this is it will have this statement in the lines.
INSERT user defined INTO user defined
that is what you need to post

has any of mwolf00 or my suggestions helped out. I don't want to start going no where with this. best way to debug is to do sections at a time.
I would suggeest going thru mwolf00 list given and checking for those values in the code and or entering them first. All the suggestions made by mwolf00 are very good as they usually are. A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Thank you onpnt - that means a lot coming from you! -- Just trying to help...
[wolf]<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
 
ok so this is what i've done.
does it look right?

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editconnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set MM_editCmd = Server.CreateObject(&quot;ADODB.Command&quot;)
ObjConn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & MM_Server.MapPath(&quot;C:\Inetpub\ wi's.mdb&quot;) & &quot;;PWD=mypassword&quot;

MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> &quot;&quot;) Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

for the first part at least!
I really do appologise for being such a nusance.
 
only two things, but I'm not sure if they will cause you problems.
Is this a valid name for a db file? non wi's.mdb

and I think if you state a PWD=password value then you need a UID=username A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
ok so i take out the & &quot;;PWD=mypassword part, and the db is called non wi's but should i take out the spaces and ' ?
 
I would name it
nonwis.mdb

that ' will also give you problems. A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
ok, now i've taken out the & &quot;;PWD=mypassword part, and changes the name of the db to one with no space or 's the script looks like this...
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editconnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set MM_editCmd = Server.CreateObject(&quot;ADODB.Command&quot;)
Set MM_editcmd = ObjConn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & MM_Server.MapPath(&quot;C:\Inetpub\
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> &quot;&quot;) Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

and when i try accessing it i get this error.

Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Haraam/wis.asp, line 114, column 30
Set MM_editcmd = ObjConn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & MM_Server.MapPath(&quot;C:\Inetpub\
ARGH!! this is bugging me now, it just doesn't want to work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top