Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Debug A VB6 Program Step By Step.


I think there is a way of walking through each step of your code as it executes in slow motion, so that you can pinpoint where its going wrong.

Can any one point me in the right direction? I have written a program, and it runs ok for the most part. However, on certain occasions, it calculates incorrectly. I want to slow down the execution in order to see where and why its miscalculating. How can i walk through my code step by step, so that i can see the result after each step?

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Create Crystal Report In Visual Basic 6.0 + Step Step Process
How to create Crystal Report in Visual Basic 6.0 + step step process ...?

How To Create Crystal Report In Visual Basic 6.0 + Step Step Process
How to create Crystal Report in Visual Basic 6.0 + step step process ...?

How To Step By Step Connect Crystal Report To Visual Basic 6.0
hi everyone

can any one help me as how to call crystal report frm vb form plz

regards rinku

Debug (Step Into)
Hi Guys
 My app is just about finished and doing some stepping in and stepping out and over and on top and so on to pic up the bugs. What I do find is when I press step in, it stops by this code with a yellow highlight line accross Private Sub t1_Timer(). There is no hint or indication of what is missing. The app runs fine without any hitches.
Any corrections or sugestions would be appreciated?

Thanks
Pieter

Private Sub t1_Timer()

img1.Visible = True
img2.Visible = False
img3.Visible = False
t1.Enabled = False
t2.Enabled = True
t3.Enabled = False
End Sub

Step By Step Tutorial For Winsock, Servers And Clients?
I just did a quick search of your forums and didnt find much help. But personally I dont feel like searching all 300 and some pages, doesnt anyone have a good step by step tutorial to create a server in visual basic using winsock and how to create servers/clients? thanks

Any Nice Step By Step VB6 Database(Access) Tutorial?
i'm new to VB6 database, need a very basic step by step tutorials about browsing data in a database, delete record, add record, etc. Any good tutorial sites about this? thx a lot

Word 97 Mail Merge Step By Step Process In VBA
Hi I was hoping someone could help me. I'm trying to merge into a document from 2 different sources. The first source contains account numbers, and the second source is a chart but with the account number as the file name. So what I need it to do is when I do a mail merge that it would merge data from source number and then call up the second source and insert it as an object into the document. I've tried to find out the step by step process of doing a mail merge, but every single time it goes to the execute code, it just runs mail merge without giving me the opportunity to insert code in between the records to allow me to insert the object from the other source. Can anyone please help? I would really appreciate anyone that can shed some light for me. If I have to loop the whole thing, I don't mind as long as I can merge the documents together. Thanks!!

Step By Step Customizing My Pocket PC Application Icon
Hey guys, can anyone of you list out the steps in as detailed as you can to making my own customized Application Logo?

I really cant understand the articles.

Can you help me out with the interpretation?

http://www.devbuzz.com/content/zinc_evb_icon_assoc_pg1.asp

I dont have good working knowledge on Visual C++ so I REALLY need your help to interpret this article for me.





Programmers are the laziest people around.

Debug ? (step Back)
F8 is to step through the program, how do you step backwards?

Step By Step CODE View? (NewB)
Another question guys:

How can run the code and view its step by step execution lines. I want it to run the code and then stop and wait for my command to continue before it moves thru the code.

I want to see in what order the code is being executed.

please help.

Walkthrough Step By Step Data Insert
Hello Im new here. great message board.

I'm kind of a newbie with VB and Access and I was wondering if someone could help me with this thing I need to do.

I want to do a kind of step by step walkthrough to save a new entrie in a table I have, I was thinking maybe to do it by saving each steps info in variables that are sent into the next form and are acumulted at the end where, if the user confirms the info gets saved with the Adocontrol.

I don't know if this is the best way to do it or if this is possible (to send a string for example into a variable in the next form). Any help would be great thanks.

Visual Basic Professional 6.0 Step By Step
I have just bought "Visual Basic Professional 6.0 Step by step" by Michael Halvorsen, but the CD was broken when I got it and the guy I bought it from is unwilling to help.
So I was just wondering if anyone have the CD and can send me the files (if they aren't too big) or if anyone can tell me where the files can be found.

I would really appreciate any help!

How To Use Immediate Window To See The Resuts , Please Explain Step By Step
how to use Immediate window to see the resuts , please explain step by step ...?

Different Behaviour: Exe Vs. Single Step Debug Mode
I realize there may be no easy (or good) answer for this, but here goes:

I have a program that, when compiled to an exe, runs correctly. When I single step through the program though, the result is not correct.

The program in question starts AutoCad 2002 and attempts to load a couple of ARX files. The exe version is successful, but single-stepping fails. I have debug.print'd all the variables and they are identical. I'm not using timers of any kind, so I don't think it's a timing issue (at least not a timing issue started by me).

Does anyone know of any issues with the run-time environment that would cause single-stepping to act differently?

thanks in advance,

flynn

Dialing A Number (step By Step)
hi, im gonna take this one step at a time now in hope that i get answers to my questions as i need them. the first one..

how do i connect with the modem and dial a number.

i am sure i would use the MScomm control and theres something about sending AT.

PS, Sorry to the admins and mods... wrong forum

Payment Step-by-step Form
This I think is going to be difficult. I have a tutorial that I am trying to figure out on how to do this but it is basic. It can be seen here http://www.fontstuff.com/access/acctut08.htm

Anyways, I have a form that I want to use for employee pay. 1. I want to select (from dropdown) the employee position (employeeInfotbl).

2.This brings up the employee names (employeeInfotbl) that hold this position. (from dropdown) and the employee is selected from here.

3. This then shows if that employee is on Wage or Salary (employeeInfotbl). If it is wage then 2 boxes come up, one with their hrly $ and one for how many hours they worked. Depending on which one he/she is on, the final amount will be added to an expense report I have as Fixed Exp. or Variable Exp.

4. Next I have date range txt boxes with calendars to choose the time the payment covers.

5. Next dropdown boxes with employee Metrics (their performance records) (employeemetricperformancetbl) for that time period show up and can be selected. Along with this is a text box for the "goal" to be set. i.e. if the boss says reach 10, that number goes in this text box. The Metric is selected and the form automatically sees if it is < or > 10. If it is, then an amount is added to their hourly wage.

6. After all this is filled in, another date box comes up so the payment amount can be put in the expense records for that date.

Anyways, I don't really have an idea of how to do this. I know I need to build the comboboxes w/o the wizard, and there needs to be queries behind each one. I just don't knwo how to get it to work with different tables. I am sure more explanation is needed so just ask if there is confusion.
Thanks all!

Does Anyone Have Step By Step Guide For Scrolling A Pic Box
What I wish to do is place a scroll bar on my form as my pic box is larger than it. I wish to scroll down to see the remainder of it.
It seems like it should be simple enough but i cant get anywhere with it

Crystal Report 8 Step By Step
i have sql query like -> "select * from emp " , now i want ot display result of query on Crystal report 8. so pls help me how to use it ? please give me steps to create at runt ime or design time ???
sample code will be appreciated
thanx in advance.


It May seem Impossible, But Possibly We don't know the way how to reach there ????

PRB: Query Runs In Step-by-step Mode, But Doesn't Run In Run Mode
Hello!
Win98 + VB5 SP3
I have simple query like "SELECT Name FROM Table WHERE Time &gt; #2000/04/09 15:20:22#". When I run the program in step-by-step mode (F8), the query returns correct result, but when i run it in normal mode, the query returns empty recordset. I open the recordset through OpenRecordset function, and I'm working with DAO, so this isn't ODBC asynchronous query and I have no idea why this happens. The query is 100% correct, because it runs correct in Access and step-by-step mode, so I think, the problem is somewhere in code.
Any ideas?
Thank you in advance,


Jack.

I Need A Step-by-step Walkthrough..
... of everything I need to pack into the P&D Wizard.

1) What is DAO? What drivers do I need to include?
2) I have alot of controls that point to images in a subfolder (G:images) so how would I assign this?
3) Everytime I include the default .dlls (epsrv, msjet35 etc) the installation reports errors but it seems that when I setup without them, my program isnt accessible.

Help would be greatly appreciated.

Update Step By Step
Hi
Following a post I just mailed this morning...
Suppose I process a query that returns 20 000 results...
I am pretty much aware that it will take a long time to :
1. Retrieve the recordset from the DB
2. Update my MSHFlexGrid using .Datasource

Is there a way to allow users to perform operations as soon as 10% of the results are entered and complete the grid update in the background without freezing the whole system.
I am already using the Fetching method, but the only advantage I noticed is that now, I can access other programs when pressing ALT - TAB while processing.
Maybe I am missing the whole package here and that I should use another object than MSHFlexgrid...
Thancx !

Direction, Not Step By Step
I am looking for advice more than a step by step how to. I have an idea for a database application that I want to build. I want it to be flexible so that I can offer the end user a choice of how they want it configured. I would like to have code written so that the app will work with say MySQL, SQL Server, or Access, maybe even a couple others.

The way I see it in my head, when the istall program was run, the user would select which database system they want to use, and point to the database or server. Then I would have code create the actual database, tables, queries, etc. based on their input and then run the application with that database.

Is this a reasonable thing to attempt? Any suggestions or advice? I am just wanting to bounce this around right now. Thanks in advance for sharing your thoughts.

I think I have seen this in a linux app called Amarok. It is a media player that allows the user to choose between SQlite, PostgreSQL, or MySQL to manage their media library.

I Need A Step-by-step Walthrough...
... of everything I need to pack into the P&D Wizard.

1) What is DAO? What drivers do I need to include?
2) I have alot of controls that point to images in a subfolder (G:images) so how would I assign this?
3) Everytime I include the default .dlls (epsrv, msjet35 etc) the installation reports errors but it seems that when I setup without them, my program isnt accessible.

Help would be greatly appreciated.

Step By Step Directions
On How you make a program that allows you to click on an image and a labal box pops up. Pelase I need to know ASAP.

If you have Aim or ICQ pelase message me

ICQ - 20476917
AIM - Butnud

Thank You,
Rob

First Step Creating Vb Program (SMS?!)
hello, how write an sms apps? using vb? is there anyone have a sample?
i searched here but i can't find full working basic sms application...

Thanks...

Incorrect Calculations, Last Step In Finishing My Program
hey everybody, nearly done my program and just having problems with the math part.

Here's the problem:

if something weighs .3125 lbs. and it costs $0.56 per .0625 lbs, then how would I get the answer?

Is it (.3125/.0625)*.56?

my friend says the answer is $2.80, but I can't figure out how to get that. Can anyone help me, am I just missing something really obvious because I'm working off 4 hours of sleep?

Advice For Next Step With &"sync&" Program
I am writing a program to sync files from my desktop to my pocketPC. At this point in writing it, I am able to copy a file(only 1 file at a time) to/from the pocketPC by entering the name of the file on the pc and the file on the pocketPC into their own text boxes and then comparing dates and copying the newer file. So it basically syncs 1 file at a time.

I attached a screenshot as an example of what I'm trying to explain above concerning the programs functionality at this stage in development.

I'm still a bit new to visual basic and need some help figuring out how to repeat the process described above on another(next) file in the same directory.

Any help with this at all would be greatly appreciated.

Here is the part of my code that is executed when I click the "sync" button:


Public Sub Sync_Click()


'Get the modified date of file indicated in txtDesktopFile text box

b$ = txtDesktopFile.Text

On Error GoTo filenotfound

a$ = FileDateTime(b$)

Label15.Caption = a$
GoTo BegingGetCeFileTime:

filenotfound:
Label15.Caption = " Not a valid path or file"


BegingGetCeFileTime:

'Initialize RAPI
FileSelBackupCEInit


srcfile = txtDesktopFile.Text 'File from pc
DestFile = txtPPCFile.Text 'file on pc

'Begin Get File Time Code
CEInit
Label1.Caption = ""


Dim ftCreationTime As FILETIME
Dim ftAccessTime As FILETIME
Dim ftLastWriteTime As FILETIME
Dim hFile As Long

hFile = CeCreateFile(txtPPCFile.Text, GENERIC_READ, FILE_SHARE_READ, vbNullString, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)

If (INVALID_HANDLE_VALUE = hFile) Then
' FILETIME "Unable to open WinCE file"

Label1.Caption = "File Copying To CE Device"
Label13.Caption = "File Copying To CE Device"

CeFindClose hFile

CeCloseHandle hFile

End If

ret = CeGetFileTime(hFile, ftCreationTime, ftAccessTime, ftLastWriteTime)
If ret <> 0 Then Label1.Caption = "File Was last Modified" Else: Label1.Caption = "File time not returned"

Label13.Caption = Win32ToVbTime(Convert2x32To64(ftLastWriteTime.dwHighDateTime, ftLastWriteTime.dwLowDateTime))

CeFindClose hFile
CeCloseHandle hFile

'Is the desktop file is newer copy it or esle copy the file from the ppc

If Label15.Caption > Label13.Caption Then

CopyFileToPocketPC

Else
CopyFileFromPocketPC

On Error GoTo ErrHandler

End If

'Info below is just to let us know if the file copied successfully or not

If CopyFileToPocketPC = False Then
MsgBox "An error occurred transferring the file"
Else

MsgBox "File copied successfully."
CeCloseHandle hFile
End If
Exit Sub

'else

If CopyFileFromPocketPC = False Then
MsgBox "An error occurred transferring the file"
Else
MsgBox "File copied successfully."

CeCloseHandle hFile
End If

Exit Sub

ErrHandler:
MsgBox Err.Number & " " & Err.Description, _
vbOKOnly + vbCritical
CeCloseHandle hFile

'End If
CeCloseHandle hFile

'End Get File Time Code
End Sub

Can't "step Into" A Working Program
I have a working VB install that I want to Step Into to learn the program and document it. However, I get 'compile' and 'out of Memory' errors after getting &H80004005(-2147467259) error. Also 'User-defined function not defined'. Any ideas?

A Step Up From .csv
OK, so the .csv format doesn't work for what I'm doing - which is, using antique Visual CommBASIC in my terminal emulator.

Is there a way for Excel to save to a file format in which each value would be separated not by a comma, nor by a tab, but rather by the ACTUAL Windows record separator (which methinks is $CHR(10) followed by $chr(13) or sump'm (why the h doesn't Windows have a one-character rec sep, like a normal OS would?))?

CommBASIC is not good at locating or extracting walues from a .csv file.

Step Help.....can This Be Done?
I'm familiar with stepping through a listbox going from the bottom up:


Code:
Dim InList as Integer
For InList = List1.ListCount - 1 To 0 Step -1

Can the same be applied if I'm comparing URLs from a collected HTML source?

Example:

Code:
Dim a as object
For each a in wb.document.links
if a.href like "*domain.com/stuff*" then
a.click
end if
next a

I'm trying to get the program to click on the last link found on the compared link ("*domain.com/stuff*"). Is this possible?

How To Do The Next Step
hello,

my name is Eran, i'm programming for the last 3 years.

i program using Visual Basic (not .net).

my question is a bit complicated :

my programming level is quite good. i program applications that handles 20 users, calling a remote database, creating reports, handles un expected errors and so on.

still i feel that i reached a point where my programming remains on it's level and i don't make enough progress. for example, i create dll's to make my code arranged yet i don't know how to use dll's to make my application more costimible. I found my self westing time on creating a lot of time on forms (such as search forms with ), without any methods that make it easier and safer.

i mentioned my background because i seek for method of making programming more easier, costimazible (for me and my clients) and most important, safer and cleaner.

i would appriciate any methods, suggestions or whatever you can contribute

thanks alot
Eran

Next Step - VB.NET Or ASP?
Opinion...

I am using VB6 here at work. I have read a bunch on VB.NET 2005. It looks like they have corrected a bunch of the stuff that has kept me from VB.NET to this point.

I have been looking at applications that are written in ASP. They have a very nice "internet" look and feel to them.

VB6 is getting a bit long in the tooth. I have been considering an upgrade. But, maybe now is the time for an ASP rewrite.

What are your opinions of the 2? That is only one factor in the equation.

How To Do The Next Step
hello,

my name is Eran, i'm programming for the last 3 years.

i program using Visual Basic (not .net).

my question is a bit complicated :

my programming level is quite good. i program applications that handles 20 users, calling a remote database, creating reports, handles un expected errors and so on.

still i feel that i reached a point where my programming remains on it's level and i don't make enough progress. for example, i create dll's to make my code arranged yet i don't know how to use dll's to make my application more costimible. I found my self westing time on creating a lot of time on forms (such as search forms with ), without any methods that make it easier and safer.

i mentioned my background because i seek for method of making programming more easier, costimazible (for me and my clients) and most important, safer and cleaner.

i would appriciate any methods, suggestions or whatever you can contribute

thanks alot
Eran

Next Step-
Hi all, this is my first ever post here.Im hopeing to learn alot from this community.But first.

I first started learning VB6 about 6-9 months ago.I bought a book called 'SAMS Teach Yourself VB6 in 24 Hours'. I liked the book,very good and I finished the book pretty quickly.

My question is which book would you all recomend I read next? I know this may largely depend on what direction I want to take VB to, but I am primarily a begginner or even novice. And want something that will take me to the next level with VB.

I have thought about getting books on API's, databases,VB.NET etc etc. but I dont know which of these would be suitable.

SO any books you all can recomend for a novice would be great..

thnx

For Next Wiv Rnd Step?
am still trying to find differant ways to shuffle cards, i was thinking using a for next loop that loops 1 to 52 times but with the step at ramdom, i tryed it and it looped forever, any ideas?

The Next Step....
I've learn't VB to a reasonable standard but wish to further my knowledge of programming by learning a new language.

I was thinking of C++ or VC++ but maybe Java is the way to go ?

What do you ppl think ??

Step?
What is step? As in:


VB Code:
For i = 1 to 10 Step 2 Next


???

Step Through A DLL
I have an ActiveX DLL for a VBScript/ASP. Is there anyway I can set VS so when I call the ASP and it calls the DLL it will step through the code? I'm sick of this freshman, write-to-file, "I got here" crap.

For I = 0 To 20 Step 2??
Alright,
For some reason, I can't seem to add the first item, 3rd item, 5th item etc. (every odd number) item of an array. If I put "step 2" at the end of the For statement, every even numbered item is added, and if I put Step 1 then nothing happens of course..

So how on earth do I add every odd item of an array??

First Step To Create Vb Help
this is my first time to create help file and enconter several problems.

can anyone please guide my step by step ??

i've searched all the post related to help file and has a brief understanding on it.

what's the first step i need to create a help file ??

from the result of seaching, here's what i think ( please correct me if incorrect)

1. create .html file using dreamweaver, frontpage or others.
2. download html help workshop from MS
3. use workshop to link all .html files together
4. compile into .chm using ??

am i correct ??

but i has several question ..

what other thing do i need to create help file ?

1. why there's so many third party software to create help system ??

2. is it more easier to use third party s/w rather than using the way i stated above ?

3. is the third party s/w allows us to create a help file just like we see in microsft word and etc ??

Step Into Vs Start
Hi

I'm getting more and more annoyed with a program I've written using the Internet Transfer Control.

When I start the program (f5), the program runs as normal. I click the button that controls the upload.. and this is where it gets weird. For some reason the program behaves differently in the 2 modes. If I step into the program, it functions as I'd expect it to. When running it on its own.. half works once(it doesn't show a pop up box that it shows when I step into the program).

If I click the button again when running the program normally it seems to hang, but when stepping over it runs ok.

Can someone explain why this should happen!?

Neil.

Step Through Available Printers
Is there a way to see what printers a user has available, and what order they are in? I know that I can see what the active printer is with ActivePrinter, and change it the same way, but how do I access the other ones?

I know that the user should have a certain printer name in his list, but I don't know how to get the number that comes after Ne...

Unsure Of Next Step
I wrote the routine Gen to work out the combobox values next to "Generals". Whenever "Race" or "Personality" is changed, I want the values to be updated in the combobox next to generals.
I am sure I did it correctly but it desont work when I run it.:-/

Controle Next Step
Hi!

Is it possible to do next step when some textbox is changed?

Example:
For x = 0 to 2
........
Next x

I want that next x happens when some textbox is changed!

Thank you!

How To Step Through An Array?
Private Sub Form_Load()

Dim i As Integer
For i = 0 To 9
array(i) = Int(Rnd() * 100) + 1
'you put the value in the array
Next i
'select the first item in the array and get the value of it
Dim a As Integer
Dim b As Integer
Dim c As Integer
For i = 0 To 9
a = CInt(Left(CStr(Array(i)), 1))
b = CInt(Right(CStr(Array(i)), 1))
c = a * b
Next i

End Sub

This is what I have. But how do I make the program step through the array to set the next random number? As it is now I only get the syntax error on this line: array(i) = Int(Rnd() * 100) + 1

New Project... First Step
Hello!

I am going to take on a new project in VB6 and was wondering how I should go about it properly?

My goal is to have a software that can access sound files (.wav) and manipulate their volume independently of another. I would also like to change their volumes in relatively small increments.

I'd like to incorporate it into my work as a musician.

If I need the volume louder in any .wav file, I want to change it in my software and then have it save back to the original .wav so it will never change until I adjust it again.

A sound calibrator for all my .wav files in many files on my computer.

Any useful suggestions to jump start me?

Thanks!

Can't Step To Form_Activate
When I debug the app with F5, Form_Load and Form_Activate get called just fine.
However, when I step through the code with F8, Form_Activate doesn't get called.

I load my form with Form2.Show

Step Into (F8) Goes Different Than Runtime
It happened to me a while ago and I can't remember how I fixed it, but now it's hapening again; I have this function(s) which works fine when I "Debug Step into" (F8) but they don't work just right at runtime. Is there a general explanation for it or it can happen only in particular cases? I can detail my case but it's kind of long story... Thanks

Step Run Problem
my project make a dll, use a .exe to call this .dll
but when I press F8, the .exe jump out,no matter how many breakpoint was set in the .dll source, the .exe will continue execute without stop/return to .dll.
I am using vb6. the project is :
http://msdn.microsoft.com/library/en...testing_21.asp

Quote:




When you press F8 to begin debugging, the Local Test Manager application will open and pass control back to Visual Basic when the tests are run.




But I never see it return.
thanks.

Copyright 2005-08 www.BigResource.com, All rights reserved