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

Crystal Report 9 y vb6

$
0
0
Hola muy buenas tardes a todos

Tengo un sistema desarrollado en vb6 que utiliza Crystal report 9 como reporteador pero me ha empezado a dar algunos problemas sobre todo en terminal services, como por eje que no reconoce las impresoras disponibles en los equipos

La pregunta es, conocen algun reporteador, no importa que sea de pago, pero que se pueda utilizar con vb6 y que lea los reportes hechos en crystal report 9

Muchas Gracias y muy buen dia

Format a Number

$
0
0
if l have say the number 1234
text1.text=Format$(1234, "##0.00")......produces 1234.00

What is the Format to produce 1,234.00

Autocomplete only considers the 1st letter?

$
0
0
I enabled autocomplete for file paths, and was surprised to find it would stop autoappending after the second letter...

Consider

C:\aa123
C:\ab123
C:\ac123

I would type C:\a and it would correctly append C:\aa123

But, if I continue, and type C:\ab it doesn't append the rest.

Is this the correct behavior? If not, any ideas for what's going on?

Access VB6 object from another class

$
0
0
If I have a simple class e.g. Basket which contains some items e.g. Description and Price. The class is instantiated and set up with required values in one module. Now how can I view the basket from another class?

[RESOLVED] Can't set edit control text color

ADODC Methods in VB6

$
0
0
what are the ADODC methods in vb6?

Determine position of UserControl on Form?

$
0
0
Trying to figure out basically where the x,y position of a UserControl is on a form, then the width/height of the form.

Obviously this is easy to do from the outside, but I need to do it from the UserControl code. It would also be easy if the Form was the immediate parent, but I can't presume that to be the case.

I feel like I'm overlooking something simple... any thoughts?

Need Help with ActiveX Command Button (Return Click Event)

$
0
0
Hi Everyone!

Sorry!

I feel ... Out of phase !!

But I have this problem which I cannot solve.

I don't find any information about it, and I don't understand how I can do it.
If you don't know the proper commands, you can't proceed, then !!


How do you get the return of the Click event, from a button inserted in a UserControl, on a common User Form!?

updating DatabaseGris from vb6

$
0
0
I want to update a database grid from vb this is my code which is not working
Code:


Private Sub Update_Bank_Balances()
Set Titles = New clsTitle

With frmTopFront.adoSo*****k.Recordset
      .MoveLast
      'Set DB to accept New Input
      .AddNew
     
      .Fields(0) = Titles.strBSName
      .Fields(1) = Titles.strSortBName
      .Fields(2) = Titles.strIbanNum
      .Fields(3) = Titles.strYears
      .Fields(4) = Titles.strAccNum(0)
      .Fields(5) = Titles.strSortCode(0)
      .Fields(7) = Titles.strGrossSum(0)
      .Fields(8) = Titles.strGrossSum(1)
      .Fields(9) = Titles.strGrossSum(2)
      .Fields(10) = Titles.strGrossSum(3)
     
      .Fields(11) = Titles.strAccNum(1)
      .Fields(12) = Titles.strSortCode(1)
      .Fields(14) = Titles.strGrossSum(4)
      .Fields(15) = Titles.strGrossSum(5)
      .Fields(16) = Titles.strGrossSum(6)
      .Fields(17) = Titles.strGrossSum(7)
     
      .Fields(18) = Titles.strAccNum(2)
      .Fields(19) = Titles.strSortCode(2)
      .Fields(21) = Titles.strGrossSum(8)
      .Fields(22) = Titles.strGrossSum(9)
      .Fields(23) = Titles.strGrossSum(10)
      .Fields(24) = Titles.strGrossSum(11)
   
     
  'Update Recordset
      frmTopFront.adoSo*****k.Recordset.Update
      frmTopFront.adoSo*****k.Refresh
  'Re-Sort DataGrids
        frmTopFront.adoSo*****k.Recordset.Requery
        frmTopFront.adoSo*****k.Recordset.MoveFirst
        frmTopFront.adoBanking.Recordset.Update
        frmTopFront.adoBanking.Refresh
        frmTopFront.adoBanking.Recordset.Requery
        frmTopFront.adoBanking.Recordset.MoveFirst
     
End With
 
End Sub

Finally. Help after Running Winhlp32.msi on windows 10/W10

$
0
0
This seemed too easy, just run the winhlp32.msi and clicking on my help.chm file, I do get the help displayed, but as a separate task.

I call this progress. But there is no link to the help file inside my W10 vb app available.

Do you suppose something can be kludged together to make it work?
One can dream.

[RESOLVED] Determine position of UserControl on Form?

$
0
0
Trying to figure out basically where the x,y position of a UserControl is on a form, then the width/height of the form.

Obviously this is easy to do from the outside, but I need to do it from the UserControl code. It would also be easy if the Form was the immediate parent, but I can't presume that to be the case.

I feel like I'm overlooking something simple... any thoughts?

Cool menu,Nice menu for vb6,Modern UI style menu

Using registry to determine OS name, any downside?

$
0
0
I just verified manually that I can determine which Windows OS I'm on from the registry:

HKEY_LOCAL_MACHINE\software\microsoft\windows nt\
currentversion
ProductName

I manually verified on W7, W8, W10 that they are valid.

This seems too easy. What's wrong here?

Using registry to determine Window's OS name, any downside?

$
0
0
I just verified manually that I can determine which Windows OS I'm on from the registry:

HKEY_LOCAL_MACHINE\software\microsoft\windows nt\
currentversion
ProductName

I manually verified on W7, W8, W10 that they are valid.

This seems too easy. What's wrong here?

VB6 Call Web Api Winhtt 5.1

$
0
0
Hello friends, I need to call VB6 with a few commands from the website, such as receiving the price of digital currency
I have a sample code but it has a problem
please guide me
To get information from the web
------------------------
Dim HttpReq As Object
Set HttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
HttpReq.SetTimeouts 1000, 1000, 1000, 1000
MousePointer = vbHourglass
HttpReq.Open "Get ", "https://min-api.cryptocompare.com/data/pricemulti?fsyms=btc&tsyms=BTC,USD&api_key=7d3728b77fe691ce0a3afce9fec890a4e11efee954216fe3094f0c833 efcc418", False
HttpReq.Send
Text1.Text = HttpReq.GetResponseHeader("BTC")
MousePointer = vbDefault
------------------------

VB6 check for sound on speakers

$
0
0
Hi,

looking at some old code to 'test for silence' on the speakers...

https://www.vbforums.com/showthread....Sound-Tutorial

Comment #4 to 'record sound', although I'm not looking to save anything, just to report if there's sound or not (I'll modify it later).

I've downloaded the zip files and I'm running the code from there, in part:
Code:

Private Sub cmdStartRec_Click()
    Dim ErrReturn As String
    Dim WaveFmt As WaveFormat
   
    ' fill in the Wave Format
    With WaveFmt
        .wFormatTag = 1 ' PCM
       
        .nChannels = 2
        .nSamplesPerSec = 48000  ' from my sound card, was 44100
        .wBitsPerSample = 24          'from my sound card, was16
       
        .nBlockAlign = .wBitsPerSample * .nChannels / 8
        .nAvgBytesPerSec = .nBlockAlign * .nSamplesPerSec
    End With
   
    ' Create the wave tile
    FileNum = FreeFile
    Open "D:\Recording Test.WAV" For Binary Access Write Lock Write As FileNum
   
    WaveWriteHeader FileNum, WaveFmt ' write the wave headers
   
    With DirectSoundRecord
        ' initialize DirectSound with exactly the same sound format as you expect to write in the file
        ErrReturn = .Initialize(WaveFmt.nSamplesPerSec, WaveFmt.wBitsPerSample, WaveFmt.nChannels)
       
        If Len(ErrReturn) = 0 Then
            ' if there was no error
            ' start recording
            .SoundPlay
           
            cmdStopRec.Enabled = True
            cmdStartRec.Enabled = False
        Else
            MsgBox ErrReturn, vbExclamation, "DirectSound Error"
        End If
    End With
End Sub

fails at:
With DirectSoundRecord
ErrReturn = .Initialize(WaveFmt.nSamplesPerSec, WaveFmt.wBitsPerSample, WaveFmt.nChannels)

and reports:
Error: -2147221164
Desription: Class not registered

I have dx8vb.dll registered...any ideas please?

Regards
Peter

why loop_2 is faster more than loop_1?

$
0
0
hi ALL ~

Code:


Private Sub Form_Load()
    Dim w As Long
   
    Const count = 100000
    ReDim aaa(31) As Long
    ReDim ccc(count, 31) As Long
    ReDim id(count) As Long
    For w = 0 To count
        id(w) = w
    Next
   
    Dim tt

    Dim i As Long
    Dim j As Long
   
    tt = Timer
    For w = 0 To 10  ' loop_01
    For i = 0 To count - 1
        For j = 0 To 31
            aaa(j) = aaa(j) - ccc(id(i), j)
        Next j
    Next i
    Next
    MsgBox Timer - tt
   
   
    tt = Timer
    For w = 0 To 10  ' loop_02
    For j = 0 To 31
        For i = 0 To count - 1
            aaa(j) = aaa(j) - ccc(id(i), j)
        Next
    Next
    Next
    MsgBox Timer - tt
   
   
End Sub

W10 Update and Scoll bar

$
0
0
Hi there

I hope that everybody is fine, and safe
Please, I would be extremely grateful if somebody could help me to detect following problem.
I am utilizing a VB6 project in W10 1909.
Following is the topic.
Since today everything has worked fine
Starting from today, we are encountering following issue:
A component
Vertical Scroll bar (VScrollBar)
is no more visible.
I have seen that the issue is due to a windows update.
https://www.vbforums.com/showthread....dows-10-update

I'd like to try to ask you a different solution, if possible.

Please, is there any possibility to make the scroll bar visible without updating windows ?
The update is regulated by the system administrator and it is not expected to arrive before 15 days.

I would be extremely grateful if you could suggest me any possible solution

I thank you in advance

declaring variables and not using them

$
0
0
HI,

One of the most common mistakes a programmer makes is declaring variables and not using them. But what is the negative effect of this, besides lines of code not used?

Reagrds!

Syntax error in FROM clause

$
0
0
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub cmdAddItem_Click()
AdoStock.Recordset.AddNew
AdoStock.Recordset.Fields("Date") = Format(Date, "dd/mm/yyyy")
AdoStock.Recordset.Fields("Category") = AdoInventory.Recordset.Fields("Category")
AdoStock.Recordset.Fields("Brand") = AdoInventory.Recordset.Fields("Brand")
AdoStock.Recordset.Fields("Item Description") = AdoInventory.Recordset.Fields("Item Description")
AdoStock.Recordset.Fields("Serial Number") = AdoInventory.Recordset.Fields("Serial Number")
AdoStock.Recordset.Fields("Stock In") = AdoInventory.Recordset.Fields("Stock")
AdoInventory.Recordset.Update

End Sub

Private Sub cmdBrand_Click()

End Sub

Private Sub cmdIn_Click(Index As Integer)
Dim StockValue
AdoStock.Recordset.Fields("Stock In") = InputBox("Enter Stock In")
StockValue = Val(AdoStock.Recordset.Fields("Stock In")) + Val(AdoInventory.Recordset.Fields("Stock"))
AdoInventory.Recordset.Fields("Stock") = Str(StockValue)

AdoInventory.Recordset.Update
AdoStock.Recordset.Update

End Sub

Private Sub cmdOut_Click(Index As Integer)
Dim StockValue As Integer
AdoStock.Recordset.Fields("Stock Out") = InputBox("Enter Stock Out")
StockValue = Val(AdoInventory.Recordset.Fields("Stock")) - Val(AdoStock.Recordfields("Stock Out"))
AdoInventory.Recordset.Fields("Stock In") = (Str(Val(AdoStock.Recordset.Fields("Stock In")) - (Val(AdoStock.Recordset.Fields("Stock Out")))))

Do While AdoStock.Recordset.Fields("Stock In") < 0
AdoStock.Refresh
AdoStock.Recordset.Fields("Stock Out") = InputBox("Enter Stock Out")
AdoStock.Recordset.Fields("Stock In") = (Str(Val(AdoStock.Recordset.Fields("Stock In")) - (Val(AdoStock.Recordset.Fields("Stock Out")))))

Loop
AdoInventory.Recordset.Update
AdoStock.Recordset.Update

End Sub

Private Sub cmdSearch_Click()
Dim SeachString1, SearchString2 As String
SearchString1 = ComboBrand.Text
SearchString2 = ComboCategory.Text

If ComboBrand.Text <> "All Brands" And ComboCategory.Text <> "All Categories" Then
AdoInventory.RecordSource = "SELECT * FROM Inventory WHERE Brand = '" & SearchString1 & "' and Category='" * SearchString2 & "'"

ElseIf ComboBrand.Text <> "All Brands" And ComboCategory.Text <> "All Categories" Then
AdoInventory.RecordSource = "SELECT * FROM Inventory WHERE Category = '" & SearchStrings & "'"
ElseIf ComboBrand.Text <> "All Brands" And ComboCategory.Text <> "All Categories" Then
AdoInventory.RecordSource = "SELECT * FROM Inventory WHERE Brand = '" & SearchString1 & "'"
ElseIf ComboBrand.Text = "All Brands" And ComboCategory.Text = "All Categories" Then

AdoInventory.RecordSource = "SELECT * FROM Inventory"
End If
AdoInventory.Refresh
End Sub

Private Sub cmdViewAll_Click()
AdoInventory.RecordSource = "SELECT * FROM Inventory"
AdoStock.RecordSource = "SELECT * FROM Stock"
AdoInventory.Refresh
End Sub


Private Sub Form_Load()
AdoInventory.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Dennis\Desktop\New folder\inventory_br.mdb;Persist Security Info=False"
AdoInventory.RecordSource = "SELECT * FROM Inventory"
AdoInventory.Refresh
Set DataInventory.DataSource = AdoInventory
AdoInventory.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Dennis\Desktop\New folder\inventory_br.mdb;Persist Security Info=False"
AdoInventory.RecordSource = "SELECT * FROM Stock"
AdoInventory.Refresh
Set DataInventory.DataSource = AdoInventory

Do Until AdoInventory.Recordset.EOF
Dim C, B As String

C = AdoInventory.Recordset.Fields("Category")
B = AdoInventory.Recordset.Fields("Brand")
ComboCategory.AddItem C
ComboBrand.AddItem B
AdoInventory.Recordset.MoveNext

Loop
AdoInventory.Recordset.Requery
End Sub
Viewing all 21198 articles
Browse latest View live


Latest Images

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