Solved

MSFlexgrid with Access 2000

Posted on 2001-07-29
6
275 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 115
change vba from autofit to 13.5 width? 4 29
clicking a shape in a frame array vb6 3 45
vbModal 12 53
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

809 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