Results 1 to 4 of 4

Thread: Strange problem with access

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    69

    Strange problem with access

    Hi,

    I make a program using an access database. When I execute the program on my computer (Windows XP Pro) I have no problem but when I try to run the program on my other computer (Windows Me) I get an error when I try to add a new record.

    The error that I get is :

    Run-time error -2147217887 (80040e21)
    A multi-steps OLE DB operation has generated error.

    I thinked it can be a dll error so I updated :

    MDAC (2,7)
    Jet 4

    and I didn't work.

    Here is my code :

    Set Cn = New ADODB.Connection
    strCn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\bull.mdb;Persist Security Info=False"

    Cn.Open strCn

    Set Rs = New ADODB.Recordset
    Rs.Open "bulletin", Cn, adOpenKeyset, adLockPessimistic, adCmdTable

    Rs.AddNew
    Rs!Numero = txtNo.Text
    Rs!Description = txtDescription.Text
    Rs!Marque = cmbMarque.Text
    Rs!Chemin = txtChemin.Text
    Rs!Operation = txtCode.Text
    Rs!Temps = txtTemps.Text
    Rs!Plainte = txtPlainte.Text
    Rs!Panne = txtPanne.Text
    Rs.Update

    anyone can help me, please
    (sorry if I make some mistakes, english is not my maternal language)

  2. #2
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi

    The Mulitple step error have nothing to do with the operating system. Usually it is because you filled a field with more characters as the field can hold. You created in access a field with length 50 and fill more in the textfield. The other reason is that you are not on a correct record, it means that you are on EOF or BOF-1

    I can assure you that it is an programming error and have nothing to do with Windows ME

    Franky

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    69
    I think you're right because I tried to add a line to check if eof or bof = true and when I added this line nothing hapenned but what I have to do if they are true to change them to false and add my new record

    Did a rs.movefirst will resolve it ?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    69
    I found my problem, it was a field in access that I put yes to Accept Null string.

    Thanks to all those who tried to help me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width