Link to home
Start Free TrialLog in
Avatar of elockste
elockste

asked on

Mysterious Empty entries in an Access Database connected with ASP pages

I have several tables in access that overnight will mysteriously add an empty row into my data. I fear I am leaving a connection open that is causing this. Has anyone heard of this or has any possible solution.
Here is an example of code I use. How I open and close the connection:

dim cnn,rst
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
Cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=d:/inetpub/wwwroot/EDlearning/training_request/Database/requests.mdb;"
sqltext = "SELECT * FROM deliver_existing"
rst.Open sqltext,cnn,3,3

'Server Side form validation to keep our database clean
dim request_id, currentdate, userid, location, name, position, division, email, telephone, align, align_descrip, course_name, tlc_code, receive, numtrain, time, train_location
currentdate = Request.Form("currentdate")
userid = Request.Form("userid")
location = Request.Form("location")
name = Request.Form("name")
position = Request.Form("position")
division = Request.Form("division")
email = Request.Form("email")
telephone = Request.Form("telephone")
align = Request.Form("align")
align_descrip = Request.Form("align_descrip")
course_name = Request.Form("course_name")
tlc_code = Request.Form("tlc_code")
receive = Request.Form("receive")
numtrain = Request.Form("numtrain")
time = Request.Form("time")
train_location = Request.Form("train_location")


rst.AddNew
rst("currentdate") = currentdate
rst("userid") = userid
rst("location") = location
rst("name") = name
rst("position") = position
rst("division") = division
rst("email") = email
rst("telephone") = telephone
rst("align") = align
rst("align_descrip") = align_descrip
rst("course_name") = course_name
rst("tlc_code") = tlc_code
rst("receive") = receive
rst("numtrain") = numtrain
rst("time") = time
rst("train_location") = train_location

rst.update
cnn.close
ASKER CERTIFIED SOLUTION
Avatar of MilanKM
MilanKM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of elockste
elockste

ASKER

thanks, I'll give this a shot..
If the result is same then try using as

sql="Insert into myTable values('"&Request.Form("currentdate")&"','" &Request.Form("userid")&"','"&Request.Form("location")&"','"&Request.Form("name")&"','"&Request.Form("position")&"','"&Request.Form("division")&"','"&Request.Form("email")&"',............"
CNN.Execute (sql)
CNN.close

There is no need of recordset here.