Results 1 to 6 of 6

Thread: Ado control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253

    Question

    With the ado data control is there a way to be able to go back and look at the other records? What I mean is this: I will go and add a new record and then change my mind. But when I go to look at the other records, I get an error saying that I can't leave the record blank. Is there any way around this?

    Thanks!!

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    51
    I think you need to use the cancel method before you try to navigate through the recordset.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253
    How do you use the cancel method?

  4. #4
    Member
    Join Date
    Aug 2000
    Posts
    51
    I have to correct my previous post. It isn't the cancel method you want to use. It is the cancelupdate method. To call that you'd have to have a command button with the code

    if adodc1.recordset.editmode <> editnone
    adodc1.recordset.cancelupdate

    Are you only using the data control or do you have command buttons in there too? By the sounds of it you have the data control add a record when you get to the end of the recordset.

    The data control is good for quick database access with little functionality, but usually you'd have a data control that is invisible with command buttons to add, delete and navigate through the recordset. You could do the same thing with no data control, just database and recordset variables.



  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253
    I have cmdupdate, cmddelete, cmdclear, and cmdadd. Where would I put this code? I have tried it in form_load, cmdupdate, cmdadd.

  6. #6
    Member
    Join Date
    Aug 2000
    Posts
    51
    If you are using VB 6, I'd recomend that you go into the add in manager (under the add-ins) menu and load the data form wizard. You can use the data form wizard to create a data form that uses either a ADO data control, or ado code. The form it will create will give you ideas on how to code your form. It won't have all the bells and whistles but it will be fully functional (It's actually not a great user interface, but it gives coding ideas).

    When you get away from using just the data control you will have a form that is MUCH more functional, but then you will get into many more issues. The coding will get MUCH more comples especially if you build it to be used in a multi user enviornment.

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