1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VB6 Data Control + Access 2000

Discussion in 'Software Development' started by B3gbie, Dec 9, 2001.

Thread Status:
Not open for further replies.
Advertisement
  1. B3gbie

    B3gbie Thread Starter

    Joined:
    Nov 30, 2001
    Messages:
    228
    Trying to link a vb6 data control to an access 2000 database using following code

    Dim SQL As String

    SQL = "Select * from " & TTDay
    datTT.DatabaseName = "Timetable"
    datTT.RecordSource = SQL
    datTT.Refresh

    The program works until refreshing the control and claims it cant find the database- any ideas why not?
    I've tried using all the DAO references and no joy.
     
  2. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    Do you have Service Pack 4 for VB, if you don't then it won't work. The intrinsic data control from earlier releases is not compatible with access 2000, if you do have the SP4 version then you must make sure that you set the database type to access 2000; and not access;
     
  3. ren

    ren Guest

    try and use the microsoft DAO 3.5 object library or higher
    then the code will be:

    With Data1
    .Connect = "Access 2000;"
    .DatabaseName = "C:\Program Files\Microsoft Visual Studio\VB98\Nwind.mdb"
    .RecordSource = "Customers"
    End With
     
  4. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    ren, that should be DAO 3.6 library, anything lower does NOT support access 2000.
     
  5. ren

    ren Guest

    i didnt realize it was only 3.6
    sorry for the mis-information
    stick to ADO most of the time, suits me fine for both sql7 and access
     
  6. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    I agree, personally I use ADO exclusively except when trying to solve problems for others that are using DAO. There is as far as I am aware only the one thing that you cannot do in ADO and have to use DAO for, this is to set a database password in code. Everything else can be done in ADO and this makes it much easier to scale an application from a prototype in access to SQL server or other larger scale back-end.
     
  7. B3gbie

    B3gbie Thread Starter

    Joined:
    Nov 30, 2001
    Messages:
    228
    Thanks, got the service pack and no problems. As a relative beginner to VB programming I have not yet played with any ActiveX stuff (nor would i know how to). Anyway, DAO seems to work now (got SP5) on V3.6.

    Cheers.
     
  8. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    Great,

    DAO is fine in many ways, especially if you are using Access databases. However it will be worth your while looking at ADO for the future. The chances are that there will be little more development of DAO and ultimately little support for it. By contrast ADO is obviously Microsoft's focus at the moment and I can see that this will be the mechanism of choice going forward. Any experience that you have with DAO will not be totally wasted as many of the methods are similar if not the same. You also have the advantage of using exactly the same syntax and mechanisms against a much wider range of databases which allows you to easily scale applications from a simple access database to a full SQL server implementation or run the identical application on different backends by simply changing the connection string of the connection object.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/61203

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice