473,386 Members | 1,674 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,386 software developers and data experts.

Error opening tables -- queries work fine.

Can anyone offer me any insight on the following problem?

I have an Access database on a company shared drive. I'm the designer and
the only user (so far). Suddenly, any time I try to open a table, Access
crashes... but if I look at that same data by *querying* the table (SELECT *
FROM [TableName]), everything works fine.

Even though my data seems fine *for now*, it's a little scary for me.
Insight? Possible solutions?

--
Message posted via http://www.accessmonster.com

Jun 27 '08 #1
3 2093
I've had this problem in the past and found it to be a corrupt record in a
memo field. Luckily, there were not too many records and identified it from
the query results. I then used the primary key from the query results to
create a delete query to remove the corrupt record.

Hope this helps,

Mark

"nimajneb via AccessMonster.com" <u42477@uwewrote in message
news:840cbe7814204@uwe...
Can anyone offer me any insight on the following problem?

I have an Access database on a company shared drive. I'm the designer and
the only user (so far). Suddenly, any time I try to open a table, Access
crashes... but if I look at that same data by *querying* the table (SELECT
*
FROM [TableName]), everything works fine.

Even though my data seems fine *for now*, it's a little scary for me.
Insight? Possible solutions?

--
Message posted via http://www.accessmonster.com

Jun 27 '08 #2
Mark,

Thank you very much for your response.

The problem seems to happen when I open *any* of my tables. I've also found
that Access crashes on me when I try changing the design of a saved query [in
the problematic database]. Unfortunately, this is a database of nearly a
gigabyte, and has millions of records in some of the tables. Mind if I ask a
few more questions...

1. Did you happen to know what records you should find in your query? I'm
trying to figure out what to compare it against.
2. Do you think it would help for me to simply create a new database and
import the tables?
3. Or, perhaps, I could create a new database, import just the structures of
the tables, and then use "linked tables" and "append queries" to populate the
new tables? (Then I could populate those tables overnight using a macro, and
I'd keep my indexes. And using queries might exclude any corrupt records.)

Grateful for any suggestions,
Benjamin / nimajneB

Mark wrote:
>I've had this problem in the past and found it to be a corrupt record in a
memo field. Luckily, there were not too many records and identified it from
the query results. I then used the primary key from the query results to
create a delete query to remove the corrupt record.

Hope this helps,

Mark
>Can anyone offer me any insight on the following problem?
[quoted text clipped - 6 lines]
>Even though my data seems fine *for now*, it's a little scary for me.
Insight? Possible solutions?
--
Message posted via http://www.accessmonster.com

Jun 27 '08 #3
Problem solved!

It wasn't my database at all, but a database to which I had linked tables. I
contacted that database's administrator, changed my links for a day or two,
and changed them back once the other database was back up.

For posterity, here's how I isolated the problem:

1. I started a new database.
2. I imported the structures of all my tables -- but not the data -- keeping
all the original names.
3. I created linked tables to all my tables. It automatically gave each
table the same name but with a 1 on the end.
4. I created a table called "Importing" to check which tables would come
through successfully. It had two fields: Table, and Status.
5. I ran the following code, which should work for any database thus
structured:

Sub Import()

Dim db As Database
Dim tbl As TableDef
Dim sql As String
Dim sq2 As String

DoCmd.SetWarnings False

Set db = CurrentDb

For Each tbl In db.TableDefs
If tbl.Connect = "" And tbl.Attributes <-2147483648# And tbl.Name <>
"Importing" Then
'Not a linked table, not a system table, and not the "Importing" table.
Let sql = _
"INSERT INTO [" & tbl.Name & "]" & vbLf & _
"SELECT *" & vbLf & _
"FROM [" & tbl.Name & "1];"
On Error GoTo ErrorHandler
DoCmd.RunSQL sql
On Error GoTo 0
'Capture the fact that the data was successfully imported.
Let sq2 = _
"INSERT INTO Importing ( [Table], Status )" & vbLf & _
"VALUES (""" & tbl.Name & """, ""Successful"");"
DoCmd.RunSQL sq2
ContinueHere:
End If
Next

ExitHere:
DoCmd.SetWarnings True
Exit Sub

ErrorHandler:
'Capture the fact that the data import failed.
Let sq2 = _
"INSERT INTO Importing ( [Table], Status )" & vbLf & _
"VALUES (""" & tbl.Name & """, ""Failed"");"
DoCmd.RunSQL sq2
Resume ContinueHere

End Sub

Thanks for your response!

Best regards,
Benjamin

nimajneb wrote:
>Mark,

Thank you very much for your response.

The problem seems to happen when I open *any* of my tables. I've also found
that Access crashes on me when I try changing the design of a saved query [in
the problematic database]. Unfortunately, this is a database of nearly a
gigabyte, and has millions of records in some of the tables. Mind if I ask a
few more questions...

1. Did you happen to know what records you should find in your query? I'm
trying to figure out what to compare it against.
2. Do you think it would help for me to simply create a new database and
import the tables?
3. Or, perhaps, I could create a new database, import just the structures of
the tables, and then use "linked tables" and "append queries" to populate the
new tables? (Then I could populate those tables overnight using a macro, and
I'd keep my indexes. And using queries might exclude any corrupt records.)

Grateful for any suggestions,
Benjamin / nimajneB
>>I've had this problem in the past and found it to be a corrupt record in a
memo field. Luckily, there were not too many records and identified it from
[quoted text clipped - 10 lines]
>>Even though my data seems fine *for now*, it's a little scary for me.
Insight? Possible solutions?
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: KemperR | last post by:
Hello Experts outhere, may be someone can tell me whats going wrong with my ADOX trial. I have an Access 2002 database with some tables and queries (views) The code listed below works well up...
4
by: Jelmer | last post by:
Hi I've been trying to create an addin similar to Find & Replace from Rick Fisher that looks thru your tables / queries / forms / modules etc.. for a reference to a string and optionally let's you...
15
by: brettclare | last post by:
I have linked a large SQL Server table to Access, however 'only' 2,195,439 records are shown and are available to query. Can I increase the size (cache??)/number of records showing in Access? ...
3
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. Basically, it works as follows: - adds records...
7
by: jnikle | last post by:
I have a database in A2003 format that's giving me this error, but it's not the same situation I've been reading about on here. In my development copy, I have imported copies of the backend's...
5
by: Omer | last post by:
Hi, I am using C# 2.0 along with MS Access database. All my queries are working perfectly fine, but one inner join query is ocntinously throwing. I ahve tried it both from code and running...
0
by: kkrizl | last post by:
I've tried to research this problem, and I haven't been able to find any references to it. Probably because I shouldn't be doing it, but it was working, and now it's not. I'm trying to develop a...
1
by: kkrizl | last post by:
I've tried to research this problem, and I haven't been able to find any references to it. Probably because I shouldn't be doing it, but it was working, and now it's not. I'm trying to develop a...
1
by: samneil | last post by:
I have 1 Database( MS Access) with 9 tables and 6 queries, Now I'm trying to view my 2 different tables on my VB6.0 using 2 Datagrids and 2"adodc".... here are the names of my two tables:...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.