Solved

MSFlexgrid with Access 2000

Posted on 2001-07-29
6
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month6 days, 4 hours left to enroll

627 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