|
-
Aug 20th, 2012, 03:16 PM
#1
Thread Starter
Addicted Member
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
-
Aug 21st, 2012, 03:29 AM
#2
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.
-
Aug 21st, 2012, 02:28 PM
#3
Thread Starter
Addicted Member
Re: database converting
thank you so much,so you mean I cant use sql with DAO am I right
-
Aug 21st, 2012, 05:12 PM
#4
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
-
Aug 22nd, 2012, 10:02 AM
#5
Thread Starter
Addicted Member
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
-
Aug 22nd, 2012, 10:13 AM
#6
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.
-
Aug 23rd, 2012, 07:18 AM
#7
Thread Starter
Addicted Member
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?
-
Aug 23rd, 2012, 09:08 AM
#8
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.
-
Aug 23rd, 2012, 06:07 PM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|