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
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • visual basic 6.0

    database question
    2
    0 Votes
    2 Posts
    0 Views
    S
    Dim Con As New ADODB.Connection Dim Rs As New ADODB.Recordset Dim Com As New ADODB.Command Private Sub Form_Load() with Con .ConnectionString = "Data Provider=SQLOLEDB; Provider=MSDATASHAPE; uid=;pwd=; Initial Catalog=dbname; Server=server-name;" .Open end with With Com .ActiveConnection = Con .CommandType = adCmdText .CommandTimeout = 0 '//never time-out .CommandText = "SELECT * FROM table-name" End With Rs.Open Com Call Read '//sub defined below End Sub private sub Read() Rs.MoveFirst while not Rs.EOF Print Rs!Field-name1 '//print to screen - whatever.. Print Rs!Field-name2 . . Print Rs!Field-namen Rs.MoveNext wend end sub :rose::rose:
  • Trapping non VB windows opening/closing

    help json tutorial
    3
    0 Votes
    3 Posts
    0 Views
    C
    Hey Simes, It's been a while since I did something like this, but I would use the windows spy utility which lets you point at open windows and get identifying properties from them. You can find the window class for this dialog box which popups then use that class to find it again in your own program. You would have to sit in a loop watching for this window to close, i.e. you are no longer able to find it. I would also Sleep in that loop so you don't check for the close millions of times, just a couple of times a second. If you look around for code that uses FindWindow or refer to the stuff I have pasted below for you, you should be a good way to your solution. Its a pretty good tutorial on using Findwindow. It's targeted at Microsoft Access VBA, but I'm sure you understand that this would work in VB. If you need more help, please dont hesitate to shout me. Hope this is of some help. PSS ID Number: Q210605 Article Last Modified on 05-16-2002 -------------------------------------------------------------------------------- The information in this article applies to: Microsoft Access 2000 Microsoft Visual Basic for Applications -------------------------------------------------------------------------------- Advanced: Requires expert coding, interoperability, and multiuser skills. This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp). Summary Through the use of a Windows application programming interface (API) function, Microsoft Access can determine if another program is already running. There may be times when you want only one instance of an application to run in Microsoft Windows. For example, if you add a command button to a form that starts the Windows Calculator (Calc.exe) program, you can start many instances of Calculator. This is an inefficient use of memory and system resources. The API function used to determine whether a specific program is running is called FindWindow(). FindWindow() returns the handle of the window whose class is given by the lpClassName parameter and whose window name (or caption) is given by the lpCaption parameter. If the returned value is zero, the application is not running. Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and
  • how do i bring backend to front end

    database question
    3
    0 Votes
    3 Posts
    0 Views
    U
    In order to retrevie data from backend SQL server.... You need to follow this step 1)first go to Project-References-select "Microsoft ActiveX data objects 2.1 library 2)then declare this value Option Explicit Dim con As New ADODB.Connection Dim Rs As New ADODB.Recordset Dim Com As New ADODB.Command Private Sub Form_Load() con = New ADODB.Connection ConString = "provider=sqloledb;uid=;pwd=;Initial Catalog=;Data Source=" con.open Then you can write code for retreiving data.. make sure that you close connection each time when you open the connection. End Sub
  • Picture Box Array Problem

    help data-structures tutorial
    2
    0 Votes
    2 Posts
    0 Views
    N
    Well the event handler of PictureBox click has an object parameter called Sender, which is actually the picturebox object clicked. To do what you want, this is what you do: Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click Dim a As PictureBox = CType(sender, PictureBox) a.Image = ..... HTH "if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler. Support Bone
  • recursive routine

    data-structures help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    C
    frank9876 wrote: thanks for trying. It makes sense to someone who is familiar with manufacturing and understands engineering product structures / bills of material. Since this is a programming forum, maybe you'd get a better response if you phrased your question in such a way that someone who knows how to code well could answer, rather than hoping someone with exprience in a very speific, non-programming field comes along. Charlie if(!curlies){ return; }
  • How I Print a Form.

    csharp
    4
    0 Votes
    4 Posts
    0 Views
    D
    In that case, you can start here[^] for the lowdown on printing Windows Forms. There is also example code here[^]. RageInTheMachine9532
  • Where can i get articles about Text file handling in Vb.Net

    csharp question
    2
    0 Votes
    2 Posts
    0 Views
    M
    Try this one: http://www.vbwm.com/articles/builder/viewer.asp?ArticleID=15[^]
  • Client Server Application

    database sysadmin architecture question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    8 Posts
    0 Views
    D
    He asked, I supplied a method to do it! I know it's a bit of an overkill :eek: but its simple and it works. RageInTheMachine9532
  • 0 Votes
    5 Posts
    0 Views
    E
    oh... Thanks a lot... in fact i need an array to store information to be excuted by a machine. Anyway, thanks a lot for ur help. Merry Christmas and HAppy New Year:-D
  • Retrieving the page number, when looking for a word in MS Word

    help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Calling an ASP page from VB

    sysadmin help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Changing the Active Forms

    8
    0 Votes
    8 Posts
    0 Views
    N
    Thanks :) ,, Thanks a lot .. My doubt is completely cleared... Thanks for explaining it so nicely ... Now I will implement this in my application. If I have any doubts later then again I will write back.
  • a newbie with a question about .net SDK

    announcement csharp dotnet help
    2
    0 Votes
    2 Posts
    0 Views
    C
    The framework and the SDK come with visual studio, you don't have to install them again. The redistributable package contains only the framework, without the SDK. I think it is included in the visual basic installation - it has to be installed only on other machines to run .net applications.
  • How can I with Tabcontrol select/focus any TabPage

    question
    4
    0 Votes
    4 Posts
    0 Views
    D
    The code I submitted was an example of how to change the Tab in code. You can use the same code in a different routine if you want. Just the most important part was TabControl1.SelectedIndex = (tab number). The rest was just keeping track of which tab was selected and what the next tab number is. Using the TabPage.Select method doesn't work the way you would expect it to. The user won't see any change in the tab that is shown if you use that method. RageInTheMachine9532
  • email

    help csharp sysadmin question career
    4
    0 Votes
    4 Posts
    0 Views
    D
    Do you have this at the top of your code? I assumed you did already, based on your example. My mistake! :doh: Imports System.Web.Mail RageInTheMachine9532
  • custom property editor

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • xmltextwriter how to append new elements?

    question xml tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • To generate An Autogenerated field

    question
    2
    0 Votes
    2 Posts
    0 Views
    D
    If the autogen'd numbers are the primary key, then you don't get to do that. Once an autogenerated number is used it is never used again, even if it has been deleted. The only way your going to accomplish this is if you generate the number yourself and keep track of which numbers have been used and which hasn't. More trouble than it's worth... RageInTheMachine9532