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

Resize form

$
0
0
hi, i have a form with various buttons picture boxes and shapes

i want to be able to click command1 and have it resize the form around shape1. so only what is inside shape 1 is visible??

Insert/Update with Query(Adodb.Command) or ADODB.Recordset(.AddNew/.Update)

$
0
0
Hello,

I was wondering which way is better for insert/update in vb6, i'm using a query(adodb.command) for doing this, but now i see another code , they use ADODB.Recordset to insert/update (.AddNew/.Update)

Can someone pls tell me the advantage / disadvantage between them ?
Which way is better ?

Thanks.

Block Interaction with webbrowser

$
0
0
hi, i just want to use the webbrowser to display a page , but i don't want to be able to interact with the page displayed
is there a way to block this? like webbrowser.enabled = false??

Ppassing parameter in query and function....

$
0
0
my test code:

Code:


Private Sub PERIODI()

    Dim CMD As ADODB.Command, PERIODO As String, PRM As ADODB.Parameter, RS As ADODB.Recordset

    PERIODO = "1SEM 2016"

    If CONN Is Nothing Then
        Set CONN = New ADODB.Connection
        CONN.Open _
                "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                                                    "Data Source=C:\DATABASE\SAL21.mdb;Persist Security Info=False;" & _
                                                    "Jet OLEDB:Engine Type=4;"
    End If


    Set CMD = New ADODB.Command
    With CMD
        Set .ActiveConnection = CONN
        .CommandText = "Endquery"
        .CommandType = adCmdStoredProc
        Set PRM = .CreateParameter("[MYSTRING]", adVarChar, adParamInput, Len(PERIODO), PERIODO)
        .Parameters.Append PRM
        Set RS = CMD.Execute
        Set CMD = Nothing
    End With


End Sub

all work fine when i lunch Endquery via Access Ide (i insert the parameter MyStrng in input window)

now i need to call Endquery via VB6 code and pass the PERIODO in MyString

Have error in Set RS = CMD.Execute, attached image and database!
Attached Images
 
Attached Files

Report Group header/footer MySQL vb6

$
0
0
I picked up a system to service is in VB6 with MySQL database.
Must include the Group Header / Footer, but does not work.
I get the error, Reports Section does the Match Data Source.

Meu código para consulta é:
Code:


            SQL = "SELECT *, venda.TotalS AS total_venda_agrupa, venda.totalc AS valor_total_venda, venda_forma_pagamento.descricao AS nome_forma_pagamento, vendaesc.QUANTIDADEprod as qtd, (vendaesc.QUANTIDADEprod * vendaesc.ValUniProd) As total_soma  FROM vendaesc,venda INNER JOIN venda_forma_pagamento ON venda_forma_pagamento.cod = venda.forma_pagamento where vendaesc.data='" & DateRat & "' AND venda.cod = vendaesc.venda group By vendaesc.venda  order by venda.cod"
           
            prs.Open SQL, gConexao, adOpenStatic, adLockOptimistic, adCmdText
           

            If prs.RecordCount = 0 Then
                MsgBox "Não foi encontrado nenhum registro correspondente a sua consulta", vbOKOnly + vbInformation, "Atenção"
                Exit Sub
            End If
           
           
           
            Do While Not prs.EOF
            Set RptFPagamentoDetalhe_old.DataSource = prs
           
                    prs.MoveNext
            Loop
   
            RptFPagamentoDetalhe_old.Show vbModal



Name:  Report.jpg
Views: 18
Size:  61.0 KB


What's wrong?? I'm desperate to finish it

Thank you guys
Attached Images
 

VB6: Webbrowser - Change dropdown values

$
0
0
Hi,

Up to 4 dropdown combo's are displayed on a webpage. They all have the same three Values; NULL, PRESENT and MISSING.

By default, all display PRESENT. I need to change all 4 dropdown option values to NULL (Nothing. Empty. Zilch)

Here's how the HTML looks to create/populate the dropdowns.

<td class="TTransactions5" style="white-space:nowrap;"><select name="TTransactions_nStatus5 id="TTransactions_0_5_0" style=""><option value=""></option><option value="Present">Present</option><option value="Missing">Missing</option></select></td>

<td class="TTransactions6" style="white-space:nowrap;"><select name="TTransactions_nStatus6" id="TTransactions_0_6_0" style=""><option value=""></option><option value="Present">Present</option><option value="Missing">Missing</option></select></td>

<td class="TTransactions7" style="white-space:nowrap;"><select name="TTransactions_nStatus7" id="TTransactions_0_7_0" style=""><option value=""></option><option value="Present">Present</option><option value="Missing">Missing</option></select></td>

<td class="TTransactions8" style="white-space:nowrap;"><select name="TTransactions_nStatus8" id="TTransactions_0_8_0" style=""><option value=""></option><option value="Present">Present</option><option value="Missing">Missing</option></select></td>

Does anyone know a way to make this happen?

Thanks.

[RESOLVED] DataReport, how to format date for yyyy in footer label.

$
0
0
I'm trying to create a DataReport footer label with text having the current 4-digit year like: (c) 2016 bla bla..

I've tested this, but its not allowed in datareport:
Code:

'cdig = Format$(Now, "yyyy")
'DataReport1.Object.labCopy.Caption = "© " & cdig & " Company name."

This used in the report caption does not format the date into yyyy:
(c) & Format(%D, "yyyy")

Solved using:
Code:

DataReport1.Sections("section5").Controls("labCopy").Caption =

need help regarding type speed check program

$
0
0
hi guyes, the attached file is a type speed checking software in vb6.
There is one Richtextbox and one simple textbox.
In RTB, The software indicates the user to type Blue word, when user typed the word in textbox, the software compare it and the wrong typed word goes red and rightly typed word goes green. User is not allowed to correct the wrong typed word.
I need help to this aspect that the user should allow to correct wrongly typed word, at any stage, (though at any line) meaning thereby software compare the word with cursor position. Secondly, software does not count the full stop and exclamation mark as mistake, it should be there. How to do this. Please help. (extract folder to D drive)
Attached Files

FolderView: Enhance Folder View "Templates" in Windows 10

$
0
0
Something that bugs me about Windows 10 is how few Folder View Templates there are to choose from:

Name:  Templates.png
Views: 49
Size:  15.2 KB

So I'm rolling up my sleeves and trying to figure out how to enhance/replace this functionality. This is a brand new project I'm starting today, written in VB6, and after initial research I already have many questions about Windows. Not so much VB6, but hopefully this is an acceptable thread. I just need a place to organize my notes and whatnot, and I'm most comfortable using MB threads for this kind of thing.


I envision FolderView's user interface as part of the context menu when you right-click the blank space on the right side of a folder in explorer. So far, I'm able to add both basic items as well as submenus, so that's all I should really need.

The actual Folder View settings for any given folder are held in the registry, so in theory it should be a simple matter to copy settings from any given folder to any other given folder or group of folders. (Like, for example: Apply this folder's view settings to all subfolders.)
Attached Images
 

calculating expiry date

$
0
0
hello programmers
I have a difficulty in calculating expiry date
I have an access table with two fields Article - ExpiryDate
I want at form load send a message for articles that their expiry date is less than a month.
for example if an aricle whose expiry date is June 9th , each time I open the form, I receive a message " Article xxxx will expire in less than a month" and then display the article with the expiry date in a listview.
This is what I'm doing
Code:

RS.Open "Select * from depenses where date()- ExpiryDate >= 30", DB, adOpenDynamic, adLockOptimistic

If Not RS.EOF Then
MsgBox rs!article & "will expire in less than a month"       
ListView1.ListItems.Clear         
            Do While Not RS.EOF
         
        With ListView2
        Do While Not RS.EOF
            With .ListItems.Add(, , "")
                .SubItems(1) = RS("article")
                .SubItems(2) = RS("ExpiryDate") & ""       
            RS.MoveNext
        Loop 
    End With   
End If

Now with such code I'm having all the articles even they have more than one month before they expire
I tried this:
RS.Open "Select * from depenses where date() - 30 >= ExpiryDate", DB, adOpenDynamic, adLockOptimistic
but the same thing
thank you

TreeView Nodes Value - Node Values Displayed Differently than source

$
0
0
Moderator: PLEASE delete this post

[RESOLVED] calculating expiry date

$
0
0
hello programmers
I have a difficulty in calculating expiry date
I have an access table with two fields Article - ExpiryDate
I want at form load send a message for articles that their expiry date is less than a month.
for example if an aricle whose expiry date is June 9th , each time I open the form, I receive a message " Article xxxx will expire in less than a month" and then display the article with the expiry date in a listview.
This is what I'm doing
Code:

RS.Open "Select * from depenses where date()- ExpiryDate >= 30", DB, adOpenDynamic, adLockOptimistic

If Not RS.EOF Then
MsgBox rs!article & "will expire in less than a month"       
ListView1.ListItems.Clear         
            Do While Not RS.EOF
         
        With ListView2
        Do While Not RS.EOF
            With .ListItems.Add(, , "")
                .SubItems(1) = RS("article")
                .SubItems(2) = RS("ExpiryDate") & ""       
            RS.MoveNext
        Loop 
    End With   
End If

Now with such code I'm having all the articles even they have more than one month before they expire
I tried this:
RS.Open "Select * from depenses where date() - 30 >= ExpiryDate", DB, adOpenDynamic, adLockOptimistic
but the same thing
thank you

Dragging Line Onto Graphics Outside Visible Client Area

$
0
0
I have graphics which extent past the visible client area.
To view these graphics I use a horizontal or vertical scrollbar.
Currently my drawing routines (e.g. rubberband line) are limitied to the client area.
I would line to expand this rubberband line capability to allow dragging of the line
into the graphic area that is outside the currently visible client area.

Only thing I can think of is:

In MouseMove, try and update the Scrollbar values which "should" cause the graphics to scroll (refresh) at the same time
the mouse is being moved.

QUESTION:
Is this the correct approach or is there a better (easier) way?

Form Not Loading?

$
0
0
hi, i have two forms

when command1 is clicked it executes form2.show. but for some reason form2 loads but with no command buttons, picture boxes, text boxes , its just blank apart from 1 option box that loads. everything on the form is set to visible = true. it does this even when compiled too?? i have never had this before and im baffled??

[RESOLVED] problem with msgbox

$
0
0
Hi programmers
I'm using this code to send a message at a form load but the message pops up when I load and unload the form
Code:

RS.Open "Select * from articles where date() - date_exp > 0 and date() - date_exp < 30", DB, adOpenDynamic, adLockOptimistic
If Not RS.EOF Then
MsgBox " some articles will expire in less than a month"
end if

The question: how can I avoid the message to pop at unload event?
thanks

Question!

$
0
0
Name:  DMC.jpg
Views: 55
Size:  31.6 KB


Hy guys, there can be a modality, by just clicking with the left click to remove one of those 2 images of the cards from the field?
Attached Images
 

Thread Lockup vb6 ActiveX

$
0
0
Hello,

I am using the CreateObject(myClass) call to run a separate thread in my VB6 application that handles network communication.

occasionally when there is network issues and (I assume a corrupt network traffic come back) I get a 'This Action cannot be completed because other application is busy. Choose 'Switch To' to activate the busy application and correct the problem.' dialog. and whenever I click on my application window, this re-appears.

Does this mean the activex - class - thread is locked up? What can be done to detect this and fix it at run time.

I am using a third party network/audio library so that may be causing the hanging in the thread.

again this only occurs when network traffic has issues/errors.

Any advice would be helpful.

Getting "Reached limit: cannot create any more controls for this form" message

$
0
0
Now what? MZ-Tools reports that I have 373 controls on my form. I guess that's a magic number. Who knew? What to do? Is there a way to patch VB6 to allow more controls?

Enable 1 command button

$
0
0
is it possible to enabled 1 command button even if the from.enabled = false
i ask this because i want to disable interaction with a webbrowser but can not find anyway to do it

Hover/Hot Listview Column

$
0
0
- How do I hover/hot focus listview column from code.
- How to click a column via code (when one clicks a manifested listview column header..it behaves like a button:: sunken and raised effect...how to do that via coding)

LucasMKG
?
Viewing all 21588 articles
Browse latest View live


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