Greetings,
I am a new user here and I am hoping some of you can help me with the ASP problem I am having now (I just started learning ASP few days ago). The error is:
Error Type:
Microsoft JET Database Engine (0x80004005)
Could not use ''; file already in use.
I do understand that I need to close down this DB file in order to solve this error. But as admin, is there any other way besides restarting and logging off from Win XP?
here is part of my code.
dim dbloc 'String to copy database location
dim dcndb 'as ADODB.connection
dim recorddb 'as ADODB.Recordset
dim strsql 'as string
dim status
status = 0
Session("ErrorMessage") = ""
dbloc = "C:\Inetpub\wwwroot\db\db1.mdb"
set dcndb = Server.Createobject("ADODB.Connection")
dcndb.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security Info=False;Data Source=" _
& dbloc
set recorddb = Server.Createobject("ADODB.Recordset")
Call dcndb.open(dbloc)
the last line is line 28. Below is how i close my DB but it seems to have failed.
if status = 1 then
dim string
string = "The sign in name is already exist in the database. Please choose another <br\>"
Session("ErrorMessage") = string
recorddb.close
dcndb.close
Server.transfer("verify.asp")
else
strsql = "INSERT into member values ( '"& sign_in &"','"& fname &"','"& lname &"','"& email &"','"& address &"', '"& zipcode &"', '"&city&"', '"&state&"', '"&country&"', '"&gender&"', '"&dob&"', '"&occupation&"', '"&password&"', '"&question&"', '"&answer&"')"
dcndb.execute(strsql)
recorddb.close
dcndb.close
end if
recorddb.close
dcndb.close
sorry coz my program is a bit messy as I am really new in ASP. Sorry for the trouble. Please ask if you need more information regarding my error.
Another thing is - this form is for registration. If there's a new user with an already exist sign in name (in the database), I should provide an error message saying "Choose another sign in name" or something but the Session("ErrorMessage") = the string does not appear, and the error that occurs is something on "Execute" <---i will post more info on this 2nd part soon
again, thanks in advance.