Results 1 to 9 of 9

Thread: database converting

  1. #1
    Addicted Member
    Join Date
    Jul 11
    Posts
    214

    database converting

    Hi I have been working on an application with access Db;now that my app is about to get finished I want to convert it to Sql.
    (for some reasons such as better security and limitation of size,I read somewhere max of an access file is 2GB)

    In order to connect to my access db ,I ve used both Data control and Adodc control.
    now my question is ;should I change all data controls to adodc for converting?


    thank you so much

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 02
    Location
    Bristol, UK
    Posts
    35,564

    Re: database converting

    Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'Database Development' forum


    You should not use both DAO (with is what "Data control" is) and ADO in the same application (no matter what database system you are working with), as you can cause all kinds of problems for yourself, such as data added/edited/deleted in one not being shown correctly in the other for a 'random' period of time after the change.

    Unless you have a very special reason, you should not be using DAO at all after the year 2001, and the VB6 help files for DAO (written in 1998) clearly state that you should not use it for any new development.

  3. #3
    Addicted Member
    Join Date
    Jul 11
    Posts
    214

    Re: database converting

    thank you so much,so you mean I cant use sql with DAO am I right

  4. #4
    PowerPoster
    Join Date
    Feb 12
    Location
    West Virginia
    Posts
    4,957

    Re: database converting

    What he said was that you should not use both.

    Really you should not use either control and should write ADO code instead but if you must use a control use the ADO and remove any references to DAO from your project.

    DAO was obsolete more than 10 years ago. VB6 includes it for backward compatiably with VB6 but is really geared to use ADO where as DAO was standard practice in VB5

  5. #5
    Addicted Member
    Join Date
    Jul 11
    Posts
    214

    Re: database converting

    thank you so much I wish I had consulted sooner with you,if I used both it's because I had to(or didn't I),I mean to connect textboxes and msflexgrids only DAOs appear in datasource properties so what else could I do?

    I appriciate if you can guide me more

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 02
    Location
    Bristol, UK
    Posts
    35,564

    Re: database converting

    I don't know how to deal with that, because like most people I rarely use bound controls, but I suspect there is an easy answer. For an explanation of why it is usually a bad idea to use bound controls, see the article Why is using bound controls a bad thing? from our Database Development FAQs/Tutorials (at the top of this forum)

    That article contains a link to the recommended alternative (ADO code), which has an example that replicates the main features of the data control. There are many other articles in the "Classic VB - ADO" section of the FAQs thread (particularly "the further steps" article), which help you to extend it in many ways - like adding search functionality, working with other controls, etc.


    Whatever the reason(s) you have, using ADO and DAO in the same project is a very bad idea, and you should avoid it.

    Using DAO at all is also a bad idea, so you should generally avoid that too.

    Bound controls have their uses, but in VB6 and earlier they are problematic for all but the simplest of situations, so should generally be avoided too.

  7. #7
    Addicted Member
    Join Date
    Jul 11
    Posts
    214

    Re: database converting

    thank you so much so I should find a way to convert my DAO to ADO; and what about dataenviroment which I have used for my reports?if I have dataenviroment and ado together is ok?

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 02
    Location
    Bristol, UK
    Posts
    35,564

    Re: database converting

    I don't use the DataEvironment, so you will need to check whether it is ADO or DAO yourself, the help in VB should be able to tell you.

  9. #9
    PowerPoster
    Join Date
    Feb 12
    Location
    West Virginia
    Posts
    4,957

    Re: database converting

    I have not used the data environment but since it was new with VB6 I would say that it is almost certainly using ADO.

Posting Permissions

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