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

Missing some data problem (Visual Basic 6.0)

Hello everyone,

I am trying to improve a program written in Visual Basic 6.0.

The program will load data from a BL file to the database, then I found there is a bug here. The program always missing some data, especially the last data of the file.

I read the program code and guess maybe the mouse pointer effects the program,so I tried to modify the number but the error is still exists.

I use many methods to fix the bug but the program still miss the data.

Here is the original code of the program:

Expand|Select|Wrap|Line Numbers
  1. Private Sub startprocess()
  2. Dim strTemp As String
  3. strTemp = Dir(dir1.Text)
  4. Me.MousePointer = 11
  5. DoEvents
  6. Do Until strTemp = ""
  7.     Select Case UCase(Left(strTemp, 2))    
  8.     Case "BLfile"
  9.           If Len(strTemp) = 8 Then
  10.              Me.MousePointer = 11                
  11.             Call LoadBLFile(dir1.Text & strTemp, strTemp)
  12.              Me.MousePointer = 0
  13.            End If
  14.      End Select
  15.         strTemp = Dir
  16. Loop
  17.  Me.Height = 2000
  18. DoEvents
  19. Me.MousePointer = 0
  20. DoEvents
  21. End Sub
Does anyone has ideas or advice about how to fix the error?

Thank you.

Yours faithfully,

beginner76
Jul 7 '13 #1
2 1128
Rabbit
12,516 Expert Mod 8TB
If it's the loading of the file that is missing data, then we need to see the code that loads the file. Not the code that calls the function to load the file.
Jul 7 '13 #2
Killer42
8,435 Expert 8TB
The Case test on line 8 can never be True, because you're checking a two-character (or shorter) string and comparing it with an eight-character value.

Allow me to break it down...
Expand|Select|Wrap|Line Numbers
  1. UCase(Left(strTemp, 2))
This takes strTemp, extracts the first 2 characters, converts them to upper case, then uses the result. So for example if strTemp contained "blfile" the result of this would be the value "BL".

Setting the value of Me.MousePointer just changes the look of the mouse pointer when it's over the form. It does not affect the operation of the code. I believe 11 changes it to an hourglass, to show the user that the program is busy.
Jul 9 '13 #3

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

Similar topics

3
by: pix | last post by:
Hello, I would like to start learning Visual Basic, and I was wondering if there are any recomendations to any ebooks, or actual books for that matter. I have my eye on this book by John Smiley,...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
5
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
4
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
11
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have seen the terms Visual Basic 2005 and VB.NET. It seems that sometimes they seem to be referring to the same thing but sometimes they are not. I also run into terms like VB9 and VB10.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.