Solved

Visual Basic question

Posted on 1997-09-12
2
502 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 69
VB6 Compile Compatibility Issue 4 91
MS Access Search and Replace Using VBA 6 59
What is MicroStrategy.NET? 2 58
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now