Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Posts
    3

    Unanswered: vb6 recordset update function for mkd database

    Hello,

    I have created a recordset from Pervasive sql control center and a vb6 form. After that I have add a save button and typed this codes. LockType is BatchOptimistic and Cursor Location Use Client-side Cursor. I can see added records from datagrid when I push the save button. But when I close and reopen the form there isnt any record. It is not saving records to database(mkd file). There is no any error message. Thats very strange.

    Is there anyone experienced a problem like that?


    Private Sub cmdSave_Click()
    With DataEnvironment1.rsRECORDSET
    .AddNew
    .Fields("FIELD1") = Me.DataCombo1.Text
    .Fields("FIELD1") = Me.Text1.Text
    .Update
    End With
    End Sub

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    As posted elsewhere:
    Can you post the full connection string and the SQL used to generate the recordset?

    One thing I noticed, you have two "FIELD1" assignments. You might check to make sure your fields are correct.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Sep 2009
    Posts
    3
    Hello Mirtheil,

    I have used DataEnvironment for connection. I looked to DataEnvironment settings for finding how can i see connection string but I cant find the string. If you want, I can send you the vb6 project.

    Before I typed the dbforums forum, I changed my program codes to field1 for easy understand by forum users. But I have made a mistake during copy paste field1 to two field name. I forget to change second field name to field2. The two field names are different in the orjinal codes

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    In my quick test, I can't get the DataEvironment to update fields at all but I get errors.
    I usually don't use the DataEnvironment preferring the control coding the connection and recordset code myself.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  5. #5
    Join Date
    Sep 2009
    Posts
    3
    Thank you very much for your answers Mirtheil. I am sorry for my english.

    Have a good day...

Posting Permissions

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