473,382 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Access VB references changing order spontaneously

3
Hi there, I'm new to posting on the forum, and I've been working with MS Access for a couple of years, but and other than that know nothing about programming.

I have a fairly simple, networked, Access database created with Access 2003. It is accessed from several different computers in my department (I don't know which computers or how often). About 8 people are entering data with an unbound form (which also records computer ID, date and time for new records so they can be tracked) and others just look at the data or edit the data table (which is not recorded in the database).

About once a week I am getting a problem whereby DAO and ADODB swap around in the VB references list. DAO needs to be above ADODB in the list for the unbound form to work, because the coding for the unbound form uses .edit. So when the references swap around, the unbound form no longer saves new records. Also, upon opening the unbound form, this error message appears when DAO and ADODB have swapped around:

"You entered an expression that has an invalid reference to the property AsianLineBreak."

AsianLineBreak doesn't appear to be a DAO or ADODB reference, and I do not use it anywhere in the database, so I don't understand why this particular message appears?

I have a VB sub which tests if the VB reference order is wrong and produces a warning message, which works when I swap the references around and test it, but which in practice, doesn't seem to work when the problem occurs. So unfortunately when the user initially encounters the problem, the first they know is the Access warning message described above, followed by Access closing down.

As soon as I put the references back into the right order, the database works fine again. But obviously I am not always around to fix it, and would rather they didn't change in the first place.

What is my best course of action? Is there a way to stop the references changing order?

Or should I give up and try to find alternative code to avoid using DAO in the first place?!

Advice would be very much appreciated!
Many thanks.
Aug 20 '07 #1
5 2568
Scott Price
1,384 Expert 1GB
Have a look at these two links to Allen Browne's website on Preventing Corruption and Recovering from Corruption

Offhand, there is no reason I know of, other than incipient corruption, for the references to change like you are experiencing.

Regards,
Scott
Aug 20 '07 #2
marton
3
Thanks Scott.

I rebuilt the database in question a week ago and I am pleased to say that the problem of references changing order on the VB reference list hasn't occurred since.

But a couple of times I have found that the database has become decompiled for no reason I can work out. But that doesn't seem to stop anything working (in the short term anyway!), so I am no longer getting panic phone calls which is the main thing!

Cheers,
Marton
Aug 28 '07 #3
JKing
1,206 Expert 1GB
If you're having ambiguity problems be sure that you are also referencing the proper library that you want to use when creating objects.

Expand|Select|Wrap|Line Numbers
  1. 'Right way
  2. Dim rst As DAO.Recordset
  3. 'or
  4. Dim rst As ADODB.Recordset
  5.  
  6. 'Wrong way
  7. Dim rst As Recordset
  8.  
Aug 28 '07 #4
marton
3
Thanks JKing for your advice - I did find one Dim rst As Recordset in my database. I then had a trawl through and found one instance where I didn't close a recordset after using it.

So I put these right, but the database was still becoming decompiled. I then realised it was happening when the database was opened by a few particular computers with Access 2000. I have asked those users to use a front-end database to access the networked database. And since then... no more problems!

So thanks for your help. It looks like: 1) the database (possibly) needed to be rebuilt; 2) the references to recordset needed to be made unambiguous; and 3) Access 2000 users needed to be discouraged from opening it directly.

Cheers
Marton (much happier now!)
Sep 24 '07 #5
Scott Price
1,384 Expert 1GB
Thanks for posting back with what worked for you Marton (much happier now!) :-)

Glad you got it working.

It's interesting that you mention the database decompiling... That is one of the first warning signs of corruption... I wonder what it is about that particular user's Access 2000 installation that was causing this? (or maybe that particular user poking around in the code?)

It's not totally out of the picture that there could be some un-handled errors only showing up on his/her computer caused by missing references, etc...

Regards,
Scott
Sep 25 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: (Pete Cresswell) | last post by:
I've got a "PlayPen" version of a production app on one user's C: drive - so they can do what-if scenarios without messing with the production data. The prod version has been running for going on...
20
by: Allen Browne | last post by:
To help you avoid some of the more common and long-standing bugs in Access, the page: http://allenbrowne.com/tips.html contains a new section entitled, "Flaws in Access". The section currently...
5
by: Upendra Agnihotram | last post by:
Hi, I am having Client-Server Access application. The source db resides on WinNT Server and some of the client systems are on Windows 2000 Professional. These days i am experiencing frequent...
4
by: Barry Young | last post by:
I have Access 2000 installed on a machine and I create the MDE just fine. When I copy the MDE file over to another machine that has Access 2000 installed, the references are hosed and I get unable...
10
by: B Moor | last post by:
Host PC: Win SBS 2003 with 2.6 GHz processor and 1GB RAM SQL Server 2000 sp3 (or latest).MS Office 2k3 I have the access 2k3 front end running on server (this may get changed) and all was well...
5
by: John Furphy | last post by:
Please excuse my ignorance in this area, being an amateur Access user. I have an Access 2000 application which runs fine, however when I convert it to Access 2002 and run it, it comes up with...
1
by: Suzi Carr | last post by:
Hello, We create querydefs in VB programs (i.e. CreateQueryDef). But as illustrated below, Access regenerates the SQL code we specify -- particularly the WHERE clause. While the new code is...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
6
by: InnoCreate | last post by:
Hi everyone. I've recently written a classic asp website which uses an MS Access datasource. I know this is less than an ideal data source as it has limited functionality. I have a search form on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.