Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 21918 articles
Browse latest View live

Visual basic 6.0 : How to read from file

$
0
0
Hello,

I have a problem with below code.
My form will display Start time and End time for each trip.
However, although I already read travel times file, below coding didn't work.
Supposedly when End time stops at 1600, the data still display a result although it should stop at 1600.
Can someone help me?

Private Sub step1()

lunch = 1

If (Ktotal <= K) And (Ctotal <= C) Then
For i = 0 To row - 1
If Tvisited(i) = 0 Then
s = 0
data(s, 3) = Val(frmDays.txtStart.Text) * 60
data(0, 4) = Val(frmDays.txtEnd.Text) * 60
T = data(s, 3)
lunch = 0
dinner = 0

frmResult.picResult.Print " Itinerary: Day " & Ktotal;
frmResult.picResult.Print poi(s)
Exit For
End If
Next i

If lunch = 1 Then

frmResult.picResult.Print " Total cost: " & Ctotal & ","
frmResult.picResult.Print " Total number of destinations: " & Z & ","
frmResult.picResult.Print " THE TOUR PACKAGE IS COMPLETED"
Else
Call step2
End If
Else

frmResult.picResult.Print "Total cost: " & Ctotal & ","
frmResult.picResult.Print "Total number of destinations: " & Z & ","
frmResult.picResult.Print "THE TOUR PACKAGE IS COMPLETED"
End If

End Sub

Delete specific Data

$
0
0
I Write this code for delete data.

Code:

con.Execute "DELETE * from Dad where SrNo = '" & Me.txtsr & "' And DadItems = "" & Me.txtitem  & " '"
There is no data delete with this code.

put GPS on a MAP

$
0
0
Hi,

I would like to load a Picture(Map of a Country) to Picturebox/Image.

how can I mark these coordinates with Data from a Database, to visualize these ..perhaps Dots or a Pin ?

I'm not the grafic expert, I can only imagine the Pictue/Map
would have to be set with X,Y coordinates



hope for Help

regards
Chris

How can put it icon or small image in Data Reports

$
0
0
Hello Everyone,

How can put it icon or small image in Data Reports.

i Need Put it 2 Icon in Data Reports.

Icon1 : Expired product

Icon2 : Not expired product


Exa:

I Have some Products is expired and some not expire

If Click Print Bottom, it will come almost 30 name in paper, I need every expire product beside icon.

and if products not expired i need put it another icon

how to do it that

How Make A Permanent Change in VB6 Program Without Involving Database?

$
0
0
I am sorry if this is a stupid question.

Lets say I want to permanently change a label in a vb form, so that the next time i launch the program, the change that i made in that label is still there. Lets say changing the company's name, or address, or telephone number, etc. All without involving database. Can I do this?

Decimal and Hex Color value confusion

$
0
0
I’m having problems understanding color values when going back and forth between decimal and hex values.

A light blue decimal value does not seem to match it’s hex equivalent.

Code:

Long decimal        13132802
        Hex      C86402

RGB decimal        2, 100, 20
        Hex        2,  64, C8

It seems like the Red and Blue values are swapped. Is this possible or am I looking at things completely wrong?

Connection string to MS access

$
0
0
Hi All,

I have an old Visual basic application that is written by someone else. I have the following connection string defined in the code. Foe the following connection string, I was told that i need to install Office access 2003 on my computer and then only the code will work. Is there any way, I can upgrade the following string so instead of office access 2003, i will start using office access 2010.

Code:

Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + gDBPath + ";Persist Security Info=False

[RESOLVED] Delete specific Data

$
0
0
I Write this code for delete data.

Code:

con.Execute "DELETE * from Dad where SrNo = '" & Me.txtsr & "' And DadItems = "" & Me.txtitem  & " '"
There is no data delete with this code.

[RESOLVED] How Make A Permanent Change in VB6 Program Without Involving Database?

$
0
0
I am sorry if this is a stupid question.

Lets say I want users to be able to permanently change a label in a vb form, so that the next time they launch the program, the change that they made in that label is still there. Lets say changing the company's name, or address, or telephone number, etc. All without involving database. Can I do this?

VB6 and crystal reports 2008

$
0
0
Hi everyone

can anyone share idea how to automate crystal reports in VB6, need to generate pdf file and send it via email as attachment.

thanks in advance

regards,
Imran

[RESOLVED] how to insert numbers with decimal numbers and calculate them

$
0
0
hey
i am trying to figure out how to calculate total amount by adding text that are coins
and it show me .5 instaed of 0.50 why?
this is the code
Code:


E.X

    Lets say i have 5 coins of 0.50 Cent yes?
    so when i type in TxtFifty.Text 5 then i need to see in the total text
    which is TxtCredittotal.Text 2.50 Cent
    but it is not working


    Dim fiftyCent As String
    fiftyCent = "0.50"
    fiftyCent  = Format$(fiftyCent * TxtFifty.Text)
    TxtCredittotal = TxtCredittotal  + fiftyCent

tnx for any help
salsa :)

[RESOLVED] Splitting long string

$
0
0
I've read in some data from a file and want to split it into sections. Each starts with [xxxxx] and the
instr position of each is an array, e.g.

1
115315
168394
213066
242387
250529
294721

I want to extract Pos 1 to 115315-1, 115315 to 168394-1 and so on.

But it's getting messy and I wonder if my approach is completely wrong. The last one is also a problem
as LOF (297817) would need to be added on.
Thanks for any help.

I cannot figure out how to do dateAdd in my coding

$
0
0
Hello everyone,

I need help with my vb6 coding.

1)I cannot figure out how to change the coding that I do previously by adding dateadd function,
this is because , i need to call the data from input file in order to display the time correctly.

I've attached the full coding below.
vb_Langkawi_Original.zip

Thanks everyone
Attached Files

Webbrowser class click

$
0
0
Code:

<div>
a href="#;" class="cur_pointer open_in1 new_act_btn col_yt center big_link" rel="" rev="e60248068a189a1ff711e9c07fc5cb5d"><img src="/images/yt_like.png" style="padding:0;margin:0;width:12px;margin-bottom:3px;"/><br />Like</a>
</div>

am trying to click this on webbrowser please help

How does a VB6 EXE wait for Events in a DLL

$
0
0
INTRO

I have a DLL that uses Events to interact with a hardware device. In summary, I am wanting to have the main EXE app to wait at various points while the hardware interface DLL does its thing with the hardware, and then passes results back to the main call app, via another DLL
(see image above)

STRUCTURE of MODULES

The EXE ;
is just a simple test app that calls various functions in the Calling DLL, which in turn calls functions in the Operating DLL.
The last Device DLL is just the normal hardware distribution driver type DLL from the manufacturer.

The Calling DLL ;
is a generic dll that does various processing for my apps including dynamically loading various hardware Operating DLL's as required, passing back common info translated from various and more specific Operating DLL's. It is kind of like a funnel I guess.

Operating DLL ;
exists per hardware device connected to the PC. It could be for any device such as a webcam, scanner and so on. These DLL's were written to talk to the generic Calling DLL at one end, and the manufacturers DLL at the other end.

SUMMARY

I am able to compile the Operating DLL into an EXE for testing. In this state it has a Form with a few buttons. Those buttons are "Open" "Close" "Scan1" "Scan2"
These same "buttons" are called via the Calling DLL when the Operating DLL is compiled as a DLL. Hope that makes sense.
So in other words, I can test the Operating DLL in native mode as an EXE - and it runs fine, and I can compile it as a DLL to be consumed by the Calling DLL.

Scan1 and Scan2 functions use Event handling.

So, the Operating DLL as an EXE , I can Open and Connect to the device via the device dll using internal calls from with Operating DLL. Work fine, events work, app steps through fine. This is mainly due I guess to the structure of the Form layout in the Operating DLL, it just what it has to per button. It still uses Events internally but externally (at the Form level) it just has to do that cycle per the button I select being Scan1 or Scan2.

PROBLEM

The issue is this, when the Operating DLL is compiled as just that, a DLL, the instructions are issues by the Calling DLL which is one level up. The Calling DLL has a code pathway and in there is a Call to the Operating DLL to tell it to Scan1.
That's fine, however, the Calling DLL then just continues on its way and does not wait for the Operating DLL to complete and return the required Data.
Therefore the Calling DLL is failing. It is just rushing through and does not receive any data back.


CODE

**This is the "Calling DLL - it consumes the Operating DLL"**

Code:

    ** This function is used to call the Operating DLL and run the Events
    **
    Private Function IScanDevice_Scan1(Collections As Template, ByVal ScanPurpose As ScanPurposes, ByVal ScanTimeout As Integer, Region As ScanRegion) As Scan_ResultCodes
   
    '* call the Operating DLL processes which use Events
    '*
    ScanCollected = Scan1(Collections, ScanPurpose, mScanTimeout, mRegion)
   
   
    '* The following should only execute after all Operating DLL stuff completes
    '*       
      MsgBox ("Scan1 Call for Operating DLL completed)
      Call printResults
    .
    .
    End Function


**This is the "Operating DLL - also can be compiled as an EXE for testing"**
Code:

    Option Explicit

    Public WithEvents obj As OPOSBiometrics   
   
    ''
    ' This implements the IScanDevice interface.
   
    Implements IScanDevice
       
    .
    .
   
    ** Used by the Calling DLL   
    Public Function IScanDevice_Scan1(Collections As BBScan.Template, ByVal ScanPurpose As BBScan.ScanPurposes, ByVal ScanTimeout As Integer, Region As BBScan.ScanRegion) As BBScan.Scan_ResultCodes
      .
      RC = TestDemo.DoBeginCapture
      .
      .

    ** This is called from the Form internally when in EXE mode
    ** and called from the Calling DLL via IScanDevice_Scan1 above
    Public Function DoBeginCapture() As RC_ResultCodes
    .
      obj.DataEventEnabled = True
      dataEvent = dEvent.BeginCapture
    .
    .
    Exit Function
   
   
    '**Event Processing**   
    Public Sub obj_DataEvent(ByVal Status As Long)

    On Error GoTo Error_DataEvent
 
    Select Case dataEvent

      Case dEvent.Identify
            dataEvent = dEvent.None

      Case dEvent.BeginVerify
        CoreScan = obj.BIR
        ret = obj.EndCapture()
        If ret = OposSuccess Then
                .
        Else
        .
        End If
           
                    obj.DataEventEnabled = True
        dataEvent = dEvent.None

        Case dEvent.Register

                ret = obj.EndCapture()
            If ret = OposSuccess Then
        .
            Else
        .
            End If
                                   
        obj.DataEventEnabled = True

            dataEvent = dEvent.None
   
    End Select
    .
    .
    End Sub



So in summary the Calling DLL displays the MsgBox and tries to run the printReport function without the Operating DLL IScanDevice_Scan1 function completing.

thanks

Keep on top

$
0
0
I'm sure there's an easy answer to this but I can't find it anywhere.

I have a small form (for reference by the user) at the side of my main form, but if you maximise the main form the small one disappears. How can I get it to stay in front?

loop / iterate all elements in legend of mschart

$
0
0
Possible to loop / iterate all elements in legend of mschart, and make bold the text of each label...

Which is the last MSInet.OCX version number?

$
0
0
Which is the last MSInet.OCX version?

Happens that I moved the online installers wich downloads online the files to install, from HTTP to FTP (within same webserver)

In HTTP MSINET works great!, but if the customer has a transparent web cache it don't works. Like thunder-cache (micro tik routers).

So for be able to work, the customer must disable the web caching.

So I moved to FTP to avoid that, now FTP protocol, the MSINET does everything automatically, while in HTTP there was VB code involved in receiving the chunks.

But.... surprice.... same server, FTP automation works very bad, I don't talks about the extra step about LOGIN FTP (which does automatically), but, it stuck, it gives errors again and again, sometimes is impossible to download 3MB size files.

And... it crashes against all FIREWALLs asking for permissions, when HTTP do not.



So, which is the last version of msinet.ocx?

USE ONLY A PART of rs1 result for mschart...

$
0
0
normally i use:
Set .DataSource = RS1
to fill Mschart

but in particular case i need to use only a part of the rs1 result.

i need to fill the mschart with rs1 part similar:

Set .DataSource = RS1.Fields(2).Value & RS1.Fields(3).Value & RS1.Fields(4).Value & RS1.Fields(5).Value

how to?

Download addoc1 data to DataGrid

$
0
0
Hello gentlemen
I have a question and a request
Is it possible to get rid of two mdb database files into one DataGrid by SQL. If so please direct me
Viewing all 21918 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>