VB6 Data Control + Access 2000

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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.
 
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;
 
R

ren

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
 
R

ren

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
 
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.
 

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.
 
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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top