[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Visual Basic question

Posted on 1997-09-12
2
Medium Priority
?
546 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
[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
2 Comments
 
LVL 3

Accepted Solution

by:
dansari earned 300 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

650 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