Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Visual Basic Classic





Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have Windows 10 and need my old 32-bit VB6 projects to run and compile on this. I have read some articles saying that tweaks and tricks has to be done and I need someone that did this before, to help me, remote control my Win10 and install VB6 for me. Anyone?

I've read these:
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Hi Experts,

Wondering if there is a way to prevent user from selecting all records in a continuous form and copying into memory?
PS, I can remove the copy/paste menus, however they can still use Cntrl+C to have that contents copied into memory

Thanks in advance.
this is my code and am sending get request using proxy how ever when i click the button the iu freezez please help.
is their a faster way without the ui freezing up ,  its only when proxy is used in winhttp it freeze  please help

RichTextBox1.Text = ""
Dim lngI As Long
For lngI = 0 To List1.ListCount - 1
If Combo1.ListIndex = Combo1.ListCount - 1 Then
        Combo1.ListIndex = 0
        Combo1.ListIndex = Combo1.ListIndex + 1
        Text2.Text = Combo1.Text
    End If
'       Text1.Text = ""
   Dim result As String
Dim url As String
Dim winHttpReq As Object
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
url = ""
winHttpReq.Open "GET", url, False
'winHttpReq.SetRequestHeader "User-Agent", "SonyEricssonT618/R401 Profile/MIDP-1.0 Configuration/CLDC-1.0"
winHttpReq.SetRequestHeader "User-Agent", Text2.Text
winHttpReq.SetRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
winHttpReq.SetRequestHeader "Accept-Language", "en-US,en;q=0.8,en-us;q=0.5,en;q=0.3"
'winHttpReq.SetRequestHeader "Accept-Encoding", "gzip,deflate"
winHttpReq.SetRequestHeader "Accept-Charset", "windows-1251,utf-8;q=0.7,*;q=0.7"
winHttpReq.SetRequestHeader "Keep-Alive", "115"
winHttpReq.SetRequestHeader "Connection", "keep-alive"
winHttpReq.SetProxy 2, List1.List(lngI), ""
'result = winHttpReq.ResponseText
   'RichTextBox1.Text = RichTextBox1.Text & winHttpReq.Status & vbCrLf & 

Open in new window


I have devlopped a "library" (heavily object oriented) contained in an access database (let's call it IM), intended to be used (referenced) by other projects (wich users can install wherever they want).
For many reasons, I make an extensive use of late binding, cept on the IM database itself.
I tryed setting a reference dynamically, that turned out to be a nightmare to manage (reference broken, name already used and so on ...)

Is it possible to late bind on the IM database ?
Or are there any better solution ?

Client code will need to either instanciate classes or use utility fonctions from IM database.
I saw about using the function, but it only work for procedures, and return no value, wich isn't my need.

Thanks for your replies.
Thanks in advance...
Option Explicit

Private Type DOCINFO
  pDocName As String
  pOutputFile As String
  pDatatype As String
End Type

Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
Private Declare Function OpenPrinter Lib "winspool.drv" Alias _
    "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, _
    ByVal pDefault As Long) As Long
Private Declare Function StartDocPrinter Lib "winspool.drv" Alias _
    "StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, _
    pDocInfo As DOCINFO) As Long
Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long
Private Declare Function WritePrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, _
    pcWritten As Long) As Long
Private Declare Function AbortPrinter Lib "winspool.drv" (ByVal _
    hPrinter As Long) As Long

Private Sub Command1_Click()
    Dim lhPrinter As Long
    Dim lReturn As Long
    Dim lpcWritten As Long
    Dim lDoc As Long
    Dim sWrittenData As String
    Dim MyDocInfo As DOCINFO
    Dim intBarcode As String
    intBarcode = "12345"
    lReturn = OpenPrinter(Printer.DeviceName, lhPrinter, 0)  ' \\\Argox

    If lReturn = 0 Then
        MsgBox "The Printer Name 

Open in new window

This is the code, how to convert this? Thank you

private void button1_Click(object sender, EventArgs e)
/* Clear the list view items */

// Stream on to the textfile
var sr = new StreamReader("data.txt");

//create an object list type of string to store your data later
List<string> l = new List<string>();

//variable to hold the data from the textfile
string data = "";

//loop through the data line by line
while ((data = sr.ReadLine()) != null)
// since it is comma separated split it with comma and check if it is equal to your textbox value
if (data.Split(',')[2].Trim().Equals(textBox1.Text))
// if found store the data to list 



//unique id
// break the loop since you found it already no need for the loop to continue
//dont forget to close the streamreader

//create a listview item object and pass the data to the list view
var item = new ListViewItem(l.ElementAt(0));


Open in new window

Hello friends I have a problem with DIGITALPERSONA ONE TOUCH READER BIOMETRIC ,I cant take and save image of finger to jpg,here is a example of my code.....

Private Sub DPFPEnrollmentControl1_OnComplete(ByVal pSerialNumber As String, ByVal lEnrolledFinger As Long)
Dim oPicture As IPictureDisp
Set oPicture = DPFPEnrollmentControl1.EnrolledFingersMask
Picture1.Picture = DPFPVerificationControl1
End Sub

really I dont know how to resoved it if anyone can help me would be a GREAT help......thank you for you time.
I want to be able to create a macro which copy's data from select cells and pastes then into another sheet. I want to be able to keep the existing data from the previous day.  By the end of the week i will have 5 days all in the same sheet.

current macro:

Sub Test()
' Macro2 Macro

End Sub
I am using WinHttpRequest in VB6 the server returns me a Jpg file. I can not load the file into a Picture Box. Can you help me please?
Concerto Cloud for Software Providers & ISVs
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Dear All,

I have a problem in calculating scrollbar position.

Issue: I have a Panel control (AutoScroll = True) inside which I have a control which change its size based on scrolwheel movement. (lets assume 1 tick at scroll - square control gets as much as doubled in size). What I want to achieve is to automatically scroll to the same position that mouse was pointing at before zoom. It's not as simple as using zoom factor, as the control inside the panel is bigger than panel.

I'd appreciate any advice.

Steps to reproduce:

- place panel and set autoscroll to true.
- place (lets say picturebox) inside a panel.
- implement any simple formula of changing size based on scrollwheel (ie. double size each step and make ~4 steps)

I want the scrollbars to update themselves after zooming (so the pointer is pointing at the same pixel on above's said picturebox) - I do not want to change pictures's box location - i want to achieve this by scrolls only.

I hope its clear. Thanks for any help given.
Hi experts, I'm trying to get the sum of the field but the code below is not working. Is there anyone can help me fix the problem? The code below will always responded yes even have no record. Thanks!

Public Function ObtainTotCreBal(code As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs = cn.Execute("Select Sum(Credit) as TotCredit, Sum(Debit) as TotDebit from SuppliersLedger where Status='" & "Unpaid" & "'")
    If rs.EOF Then
        MsgBox "No"
        MsgBox "Yes"
    End If

Set ObtainTotCreBal = rs
Set rs = Nothing
End Function

Open in new window

I had this question after viewing How to create dropdown with autofill/autocomplete in Excel.

Can i use the code you provided  in the the "this workbook" or module in Vb? I have so many sheets and i though its better to do it one time  rather that pasting this to all sheets in VBE.

If it also not too much to ask, may I add in my question; if this code can be done that any string to be inputted in the combo box will provide suggestion options from the data validation drop down  list (really like a google type behavior)?

how to browse in Dos environment
i'm working on an old vb6 application.

I'm using the vaSpread grid control.

So if i have a vaSpread grid with ID of MyGrid1

how do I setup a button click event that checks to see if the grid contains any data.

So after I press the button,

if the grid has data display this message in a message window:

"The grid has data."

if the grid has no data display this message in a message window:

"Sorry, the grid has no data."

I am running MS Access 2000 and Outlook 2000 on an XP machine.

I made a change to the reference for the Outlook Object Module which was to select the MSOUT.OLB file instead of MSOUTL9.OLB.

MSOUTL.OLB is the Outlook Object Library that comes with Win10... MSOUTL9.OLB is the file that came with Office 2000 (which is version 9)

The change screwed up a compiled VB6 program which now no longer runs.
I went back into MS Access as reselected the original file but the problem with my VB6 program, which also uses the Outlook Object Module, still exists.

This problem was definitely caused by this change.  The VB error I receive is Error Loading DLL.

I've performed an Access 2000 repair and it did not help.  Perhaps I need to re-register a DLL?  if so, which one??  

Please help!  Willing to try anything!
I am not able to delete  internet Explorer History Folders  on Week based . like i want to delete only 4 week ago folder. please help me
I am not a programmer and know nothing about programming but I need a little help if anyone could?

I have an old XP program which has no support anymore... It runs an MS Access database which I can access

I want to increase the size of the text on my printer

In the database there are lines like this CHR(27)+CHR(33)+CHR(1)  which I may or may not be correct in assuming they effect the printer output

Is there a way to increase the text output to the printer using the Access database ?
ID      PrinterName      PrinterType      FullCut      PartCut      DelayBeforeCut      Activate      NormalPrint      LargePrint      XLargePrint      OpenTill
1      AXIOHM A714      1      CHR(27)+CHR(105)      CHR(27)+CHR(109)      5      CHR(27)+CHR(68)+CHR(20)+CHR(0)      CHR(27)+CHR(33)+CHR(1)       CHR(27)+CHR(33)+CHR(33)      CHR(27)+CHR(33)+CHR(49)      "CHR(27)+""p""+CHR(0)+CHR(255)+CHR(25)"

This is the data in Access.

I need normal print to be large? Can I just swap the codes?

Would that work?

Is there anyway to access the actual program to change the settings if not?


I had to change the computer I use for my vb6 programming.  When I try to re-compile a module I get a Break compatibility warning.

Old Computer:  Win 10
New Computer: Win 7

Below is the reason for the compatibility issue:

Original Definition:
Property Set to Connection(RHS As ADODB.Connection_Deprecated)

Current Definition:
Property Set Connection(RHS As ADODB.Connection)

Where does Set Connection(RHS As ADODB.Connection) come from and how do I set it to Connection(RHS As ADODB.Connection_Deprecated)
Concerto's Cloud Advisory Services
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Hi Everyone,
I am using one VBS which delete and Insert records from Excel. But need some adjustments here.
For example this script deleting 10 records and inserting 10 records into Excel, but replicating some records again at right side again and again after each run.
And my Excel has 3 multiple Sheet, but I need to insert into a particular sheet i.e. Sheet2
after execution I am seeing these defects
1. Legends moved to somewhere else,
2. row 1-6 repeated but right side.
Here is my CSV data.
But after second run data got inserts some other place.
"ABC","Pune",123,"Expert Value","! Easy","Popular"
"XYZ","Kol",567,"! Expert value",Easy,"!Credit"
"PQR","Mum",234,"NOT value","Value for money","Debit"
"RST","DEL",0,"Value","NO value","N/A"
"Ram","KOL",100,"NO Value","value","N/A"
"XYZ","Kol",567,"! Expert value","!Easy","!Credit"
"qwer","DEL",567,"Expert value","Easy","!Credit"
"cvbn","Pune",567,"! Expert value","!Easy","!Debit"
"rtyu","DEL",567,"! Expert value","Easy","!Credit"
"kllo","Pune",567,"Expert value","NOT Easy","!Bad"

Open in new window

Here is my existing VBS.
srccsvfile = Wscript.Arguments(0)
tgtxlsfile = Wscript.Arguments(1)
'Create Spreadsheet
'Look for an existing Excel instance.
On Error Resume Next ' Turn on the error handling flag
Set objExcel = GetObject(, "Excel.Application")
'If not found, create a new instance.
If Err.Number = 429 Then  '> 0
  Set objExcel = 

Open in new window

I am making slow progress with my treeview. The latest problem is the first child node repeating until Access give an error 3014 'Can't Open Any More Tables'

What am I doing wrong?

Private Sub addChildren(tv As TreeView, nodParent As node, rsReqs As DAO.Recordset, lngParentID As Long)
   Dim strFind As String
   Dim strSQL2 As String

  Set rsReqs = CurrentDb.OpenRecordset("Query2")
   strFind = "HeaderID=" & lngParentID
   rsReqs.FindFirst strFind
   Dim nodX As node
   Dim strBook As String
    Do While Not rsReqs.NoMatch
      Set nodX = tv.Nodes.Add(nodParent, tvwChild, , Left(rsReqs!StockCode, 50))
      strBook = rsReqs.Bookmark
      addChildren tv, nodX, rsReqs, rsReqs!HeaderID
      rsReqs.Bookmark = strBook
      rsReqs.FindNext strFind
End Sub

Open in new window

bjr.  je suis étudiante et ma thèse de soutenance porte sur SDWAN, SDN, NFV ,VNF.  besoin d'aide ou des sites qui pourront m'aider
I want to download Google Mutual Fund historical data. This code snipit works fine:

      With ActiveSheet.QueryTables.Add(Connection:= _
         "URL;", _

But, I would like to change the cid code, startdate and enddate to variables but everything I try doesn't work. Example,

changing the cid code to a string:

      id = 298525784073028
      With ActiveSheet.QueryTables.Add(Connection:= _
         "URL;", _
I have some textbox and a listview on my form, when I click the add button, I Want the items on this control to be added to a single roll in access database, is it possible in vb6.0
I have an application running in classic ASP coding with HTML pages and in one .asp page the client requested for a button. This button when clicked, it must export whatever the data present in Table of Access database (already in use) to an excel sheet. Kindly help as i have been searching for this sort of code everywhere.

Visual Basic Classic





Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.