Solved

MSFlexgrid with Access 2000

Posted on 2001-07-29
6
273 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

21 Experts available now in Live!

Get 1:1 Help Now