Mysterious Empty entries in an Access Database connected with ASP pages

Posted on 2006-05-19
Last Modified: 2010-04-17
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("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

Question by:elockste
    LVL 14

    Accepted Solution

    try adding following lines after CNN.CLOSE & say is there any problem there.

    set RST = nothing
    set CNN = nothing


    Author Comment

    thanks, I'll give this a shot..
    LVL 14

    Expert Comment

    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)

    There is no need of recordset here.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    has77  challenge 9 56
    mergeTwo  challenge 13 53
    mapAB Challlenge 35 54
    Microsoft C++ code failing in executable that worked 8 14
    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    A short article about a problem I had getting the GPS LocationListener working.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now