Skip to content

Visual Basic

Visual Basic Questions

This category can be followed from the open social web via the handle visual-basic@forum.codeproject.com

34.4k Topics 120.1k Posts
  • operation not allowed when object is closed

    question help
    2
    0 Votes
    2 Posts
    0 Views
    H
    this mat be the problem Set RS = Conn.Execute(uSQL) you need to call Conn.Open
  • getting a single row in a dataview how

    csharp question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Newbie question: Default installer path name

    csharp visual-studio question help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Icon full quality issue

    question com graphics help
    4
    0 Votes
    4 Posts
    0 Views
    N
    How do you do this then?? http://www.nico.gotdns.com
  • Implementing an interface (quandry)...

    regex question
    3
    0 Votes
    3 Posts
    0 Views
    R
    I had tried (at least I thought that I had) to to that was when I tried to implement the interface I looked like I was forced to impliment BOTH the AddEntry methods in my class. I think my problem was that NONE of the parameters to the methods matched in my case. I was trying to use: AddEntry(entryText As String) AddEntry(varName As String, varValue As String) Perhaps if I used the naming that you example did where at least one of the vars matched things would have been better? I actualy am testing a version that uses an abstract base class now and it seems to be working well. I actually found some implimentation that was common so it ended up helping in reducing code duplication as well. Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."
  • calling a subroutine at the beginnign

    question tutorial
    3
    0 Votes
    3 Posts
    0 Views
    P
    add a Sub Main module. then change your project preferences sub Main frmConevert.show vbModal,me end sub ---- sub Form_Load ' setup pic_unitDisplay.Print "1. inch", "2. fathom", "3. foot" pic_unitDisplay.Print "4. furlong", "5. kilometer", "6. meter" pic_unitDisplay.Print "7. fathom", "8. rod", "9. yard" end sub
  • Remote execute an application(executable).

    xml csharp wcf sysadmin
    2
    0 Votes
    2 Posts
    0 Views
    P
    not sure about vb.net, but this should still work. Search the WMI stuff relating to remote launching, you basically connect to the server(remote machine), then tell it to create a process. I've written a component to do this in C++, but the reason for that is I'm using a Dialup connection to connect to 380 machines, and I need other operations to continue whilst the WMI connection starts(in a thread). If you don't have these issues, there are lots of WMI examples in MSDN for doing this. This is a function I've used previously. Function LaunchRemoteProgram(program As String, Optional user As String = "", Optional pass As String = "", Optional servername As String = ".") As Integer Dim objLocator As WbemScripting.SWbemLocator Dim objService As WbemScripting.SWbemServices Dim objInstance As WbemScripting.SWbemObject Set objLocator = New WbemScripting.SWbemLocator On Error Resume Next If servername = "." Then Set objService = objLocator.ConnectServer(".", "root\cimv2") Else Set objService = objLocator.ConnectServer(servername, "root\cimv2", user, pass) End If If Err.Number Then ' LaunchRemoteProgram = Err.Number Else Set objInstance = objService.Get("Win32_Process") objInstance.Security_.AuthenticationLevel = wbemAuthenticationLevelConnect objInstance.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate objInstance.Create program, Null, Null, LaunchRemoteProgram End If End Function Hi this is of use to you.
  • query on createobject

    help question database tutorial announcement
    4
    0 Votes
    4 Posts
    0 Views
    P
    whilst you are debugging, you could install the component in COM+ with the Interactive User as the identity. Then when you need to recompile the componet, just choose ShutDown on the COM+ package. Also you could add reference to the COM+ typelibraries etc, and then search for the application and unload/shutdown it in code. THis has worked very well for me whilst making a Checkout system for an ecomm site.
  • How to acces the component running on another machine

    com sysadmin tutorial
    2
    0 Votes
    2 Posts
    0 Views
    P
    on the machine where you have installed the component in COM+, go to the application, and choose Export. Then select Application Proxy. This will setup the right informaiton, and create an MSI installed file. Now go to the machine where you want to use the component, and run this MSI. YOu will now be creating the instance of the component on your com+ server.
  • MSHFlexGrid's

    question css
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • This control array should work, right?

    csharp database data-structures question
    6
    0 Votes
    6 Posts
    0 Views
    D
    Thanks for the reply. But I'm new to .NET. If you mean, have the main form inherit from System.Windows.Form.IContainerControl it doesn't work. At least I get an error that says classes can inherit only from classes.
  • Kazaa Search Automation

    c++ testing tools question
    2
    0 Votes
    2 Posts
    0 Views
    M
    DDE?
  • displaying a checkbox in access as a checkbox in vb

    css database help question
    2
    0 Votes
    2 Posts
    0 Views
    M
    No, use a 3rd party control. Or use a ListView and add controls to edit the ListView above it with a Checkbox for the Field you'd edit.
  • VB.NET ComboBoxes

    csharp help tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • textbox loosing focus

    help css question
    3
    0 Votes
    3 Posts
    0 Views
    M
    First of all, make sure you have another Control that can get Focus (i.e. It must be Enabled and if there is an "AllowFocus" property, set it to true). Then in the Validate Event: If (txtFind.Text.Length = 0) Then txtNext.Focus():Exit Sub 'Otherwise, populate Grid Here
  • Make Window Flash 3 Times

    csharp adobe help question
    4
    0 Votes
    4 Posts
    0 Views
    R
    actually its very simple to do just open the api viewer (either thru addin menu in the ide or from program group (tools) then load file win32api.txt in the api viewer (file->open) add declaration for FlashWindow in ur code another alternate way is to search for file WIn32api.txt (in visual studio folder\common tools) and copy decl of the function in ur code now all u have to do is to just call the function FlashWindow anywhere in ur code and see ur window flashing once put the first param as -> and 2'nd param is to specify whether window inverts its state after flasing or not (See MSDN) if u want to flash n times then add FlashWindowEx function along with FLASHWINFO struct in same way as i told u i hope now u can make it work enjoy
  • report width larger then paper width

    help question
    2
    0 Votes
    2 Posts
    0 Views
    T
    try decreasing the report size in the design...i.e. pull the side inwards a little bit....
  • GUI design problem

    design help
    2
    0 Votes
    2 Posts
    0 Views
    M
    I think so you are having a problem, As per the problem i understand is When you open the dialog box to display and store it in a variable the system time and date is stored. But when the user selects Ok button or cancel button the time gets changed. When you next call now function. it is better to use date function and time function this will give you the current time and todays date. Thanks! Manoj Madhavan;)
  • RecordSets In ADO for VB6

    help database debugging
    6
    0 Votes
    6 Posts
    0 Views
    R
    I am attempting to connect to an Access Database with not much data and am using MDAC version 2.70.7713.4...I have worked around the problem. I noticed that the record I was querying for and then using movefirst to retrieve, was added immediately prior to performing the query for the value associated with the record added. Before: 'If record did not exist then add record Dim rs As New ADODB.Recordset SQL = "TableName" rs.Open SQL, dbMasterConn, adOpenKeyset, adLockOptimistic, adCmdTable rs.Addnew rs!code = varCode rs.Update 'Following this a rs was filled for generic instances where record did or did not exist for the record just added. Record was only added if it did not exist but the code is needed regardless of whether record did or did not exist Dim rs As New ADODB.RecordSet rs.Source = "SELECT code FROM TableName where condition" rs.CursorType = adOpenForwardOnly rs.ActiveConnection = dbMaster rs.Open rs.MoveFirst <--it stuck here CodeNeded = rs!code After changes: 'If record did not exist then Dim rs As New ADODB.Recordset rs.ActiveConnection = MasterDb SQL = "TableName" rs.Open SQL, , adOpenKeyset, adLockOptimistic, adCmdTable rs.Addnew rs!code = varCode rs.Update CodeNeeded = varCode else(if record already exists) Dim rs As New ADODB.RecordSet rs.Source = "SELECT code FROM TableName where condition" rs.CursorType = adOpenForwardOnly rs.ActiveConnection = dbMaster rs.Open rs.MoveFirst <--no longer stuck here and ran. CodeNeded = rs!code A very good detailed link that helped with making connections, creating recordsets, reading and adding values to recordsets etc for both DAO and ADO was: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acchap2.asp