• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

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
0
elockste
Asked:
elockste
  • 2
1 Solution
 
MilanKMCommented:
try adding following lines after CNN.CLOSE & say is there any problem there.

set RST = nothing
set CNN = nothing

Thanks
MilanKM
0
 
elocksteAuthor Commented:
thanks, I'll give this a shot..
0
 
MilanKMCommented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now