From LotusNotes to MDB

Posted on 2006-06-07
Last Modified: 2013-12-18
Hello !

I got a problem to write script for migrating data from lotusnotes to MDB file. my exsample script is as you may see below:

My problem is that if my table in MDB file has a additional field and this field's datatype is AutoNumber. when I try to run, it does not add new record to MDB file. But once I remove this Autonumber field, my script can add new record to MDB file.

Can anyone help to advise why it's so ?

 Dim result As New ODBCResultSet
     Dim con As New ODBCConnection
     Dim qry As New ODBCQuery
     Dim temp As String
     Set qry.Connection = con
     Set result.query = qry
     qry.sql = "SELECT * FROM BOM"
     Call result.Setvalue("PDRNo", "TEST3")
     Set result.query = Nothing
Question by:mpitak
    LVL 22

    Accepted Solution

    Hi mpitak,
    that sounds like normal behaviour to me.

    The autonumber in relational database gets incremented in front end, when you go to new row.
    That means that when you add new row using back end script the database gets confused.

    If it's a one time transfer disable autonumber and import your data, then enable autonumber.

    If it's to be done regularily disable autonum and assign it using your script.
    To get current number of rows use (if I remember right) "SELECT COUNT * FROM BOM"

    Hope this helps,

    Author Comment


    Thanks for you advise. However, it will be troublesome to disable as this MDB file is also used by other VB.NET program. So this autonumber is used by that VB program as well.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
    Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video discusses moving either the default database or any database to a new volume.

    758 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

    12 Experts available now in Live!

    Get 1:1 Help Now