Solved

MSFlexgrid with Access 2000

Posted on 2001-07-29
6
274 Views
Last Modified: 2007-12-19
Hi,

I would like to find out how we can integrate MSFlexgrid with Access 2000. I am only able to do so with Access 1997.

Under the project's References, I have included Microsoft DAO 3.6 Object Library. Do I need to use ADO? Pls provide more details.

I am not able to refresh the grid after a deletion of a record. The deleted record can still be seen on the grid, even though I have refreshed the grid.

Appreciate your help on this cos I am be bugged by it for quite some time.

Thanks,
bearT
0
Comment
Question by:bearT
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:pierrecampe
ID: 6332420
thats very little information you have given
it should work with DAO 3.6
if you could post some code ?
what may cause problems is that you updated a 97 db to a 2000 db and you have not changed the connect property of the datacontrol,the connect property has to be access 2000 and not access
0
 

Author Comment

by:bearT
ID: 6334696
Hi,

This is how I have connected to the database:
Set db = DBEngine.Workspaces(0).OpenDatabase(App.Path + dbAccess)

May I know if the above statement is correct?

Thanks!

BearT
0
 
LVL 6

Expert Comment

by:pierrecampe
ID: 6335439
hard to say
App.Path + dbAccess should be App.path & dbAccess
but then again what is 'dbAccess'
also app.path will return 'c:\' if installed in the root
and if 'dbAccess' is something like '\mydb.mdb' then the result will be 'c:\\mydb.mdb' what will generate an error
on the other hand if not installed in the root and 'dbAccess' is 'mydb.mdb" then the result may be something like 'c:\somesubdirmydb.mdb" what will generate an error to(unless you have a somesubdirmydb.mdb in the root)
so if 'App.Path + dbAccess' does not give an error it is ok
the thing is if you can do it with 97 and DAO 3.5 then you can do it with 2000 and DAO 3.6
so what are some possible reasons it wont work:
you have made a program with DAO 3.5 to work against Accses 97
then you have changed DAO 3.5 to 3.6 to work against Access 2000
if you have no datacontrols that will work without problem
if you have datacontrols they will still use DAO 3.5 so you will have to remove them, save your program and quit vb
start vb again open your program insert at new the datacontrols and make sure their connect property is access 2000 *not* access
an other possibility is you have a reference to ADO with a greater priority than the reference to DAO 3.5
if so remove the ADO reference or give it a lower priority or prepend your db and recordsets with DAO
ie:
dim db as DAO.Database
dim rs as DAO.recordset
an other possibility may be the recordset of the datacontrols is a snapshot instead of a table/dynaset
also remember a flexgrid is not dynamicly bound to a datacontrol it is kind of one-shot bound in that once it has read the data in, the data stays static and it wont reflect changes to its datacontrol
as you can see its hard to tell why it wont work without knowing how you code it

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:bearT
ID: 6337297
Hi,

Thanks for the detailed explaination.

1) There is no problem with "App.path & dbAccess" cos I have defined dbAccess as a variable separately.

2) I have attempted to create a new project and this is how I did it.
- select DAO 3.6
- insert data control(Data1) and MS Flexgrid onto the form
- set the RecordSet Type of Data1 to dynaset
- connect MS Flexgrid to Data1
- I have coded the grid this way:

Data1.DatabaseName = App.Path + "\db.mdb"
Data1.RecordSource = "SELECT * FROM Price"
Data1.Refresh

I have these problems:
- There is no "Access 2000" in the Connect property of the data control. Only "Access" is displayed along with the other options. Even when I tried to code this manually by writing -> Data1.Connect = "Access 2000", I get an error:
"Error 3170 : Couldn't find installable ISAM"

- If I just select "Access" for the Connect property, then the system will give me this error:
"Error 3343: Unrecognised database format 'C:\test\db.mdb'". I am always facing this error, but if I change the database to Access 1997, then I would not have any problems.

I have checked that there were no DAO and ADO references. If you do not mind, pls kindly email me at beart24@yahoo.com for the source code, if the details that I have provided is not suffcient.

Appreciate your help and thanks!

BearT
0
 

Author Comment

by:bearT
ID: 6337298
Hi,

Thanks for the detailed explaination.

1) There is no problem with "App.path & dbAccess" cos I have defined dbAccess as a variable separately.

2) I have attempted to create a new project and this is how I did it.
- select DAO 3.6
- insert data control(Data1) and MS Flexgrid onto the form
- set the RecordSet Type of Data1 to dynaset
- connect MS Flexgrid to Data1
- I have coded the grid this way:

Data1.DatabaseName = App.Path + "\db.mdb"
Data1.RecordSource = "SELECT * FROM Price"
Data1.Refresh

I have these problems:
- There is no "Access 2000" in the Connect property of the data control. Only "Access" is displayed along with the other options. Even when I tried to code this manually by writing -> Data1.Connect = "Access 2000", I get an error:
"Error 3170 : Couldn't find installable ISAM"

- If I just select "Access" for the Connect property, then the system will give me this error:
"Error 3343: Unrecognised database format 'C:\test\db.mdb'". I am always facing this error, but if I change the database to Access 1997, then I would not have any problems.

I have checked that there were no DAO and ADO references. If you do not mind, pls kindly email me at beart24@yahoo.com for the source code, if the details that I have provided is not suffcient.

Appreciate your help and thanks!

BearT
0
 
LVL 6

Accepted Solution

by:
pierrecampe earned 200 total points
ID: 6338743
my best guess is that you have not installed service pack 4 or 5
if so install at least service pack 4
if that does not solve it just say so and i'll post here an email adress where you can send the sources
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now