Solved

Visual Basic question

Posted on 1997-09-12
2
497 Views
Last Modified: 2013-11-25
Dear experts

I have some trouble with data control. The refresh method runs one time.
If I want to repeat it again an error occurs.

I made the following steps

I made a temporary table for changing values:
-db.Execute  "select * into [tempTableName] from [TableName]",dbFailOnError
-db.TableDefs.Refresh
-data.RecordSource=tempTableName
-data.refresh ' no error occurs at this first execution of refresh.

Then I change a value in dbGrid (dbgrid.DataSource=data )
-data.UpdateRecord
Save table with  tempTableName to table withTableName
-data.RecordSource="dummy" 'is a empty table in db
-data.refresh ' no error occurs
-db.Execute "drop table [TableName]",dbFailOnError
-db.Execute "select * into [TableName] from [tempTableName]",dbFailOnError
-db.Execute "drop table [tempTableName]",dbFailOnError
-db.TableDefs.Refresh
Then I want to show the same table in the dbGrid
-I made a temporary table and then
-data.RecordSource=tempTableName
An error occurs, if the data.refresh method is executed again
Remark:
The error occurs at one special  table only. The table consists of 41 Columns,13 Rows.
At all other tables no error occurs.
Error message occurs in different VB4 moduls:
 
dbGrid.ocx 0005:341B
DAO2516.DLL 002D:0044
...

Thanks for any help!

0
Comment
Question by:micha71
2 Comments
 
LVL 3

Accepted Solution

by:
dansari earned 150 total points
ID: 1434818
micha71:

Didn't the error occur because you executed a 'drop tempTableName' before setting the RecordSource to that table that does not exist any more?  The Refresh probably failed because of this.

If I'm getting something wrong here, please comment.

0
 

Author Comment

by:micha71
ID: 1434819
Dear dansari

I do have the tempTableName indeed.
Because I deleted them after SYSTEM CRASH.

I execute a ' select * into tempTableName from TableName ' before
the RecordSource will be set again.

Thanks
0

Featured Post

Free Trending Threat Insights Every Day

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.

Join & Write a Comment

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…
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…
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now