4,911 Posted Topics
Re: You are being taught to program because it is important to be able to analyze and describe a process in detail, and at some point you will need to have an appreciation for the work that goes into developing an application. For a non-programming example, try to write out a … | |
Re: You could try psexec from the SysInternals (free) suite. You can download it from [URL="http://technet.microsoft.com/en-us/sysinternals/bb842062"]here.[/URL] This excellent suite was developed (mostly) by Mark Russinovich. | |
Re: There are a few things you have to do before you even start writing code. [B][U]Determine the structure of your database[/U][/B] Determine what tables you need and what fields will appear in each table. One of the tables will be the libraries table and will contain at least two fields, … | |
Re: If I might make a suggestion. Have you considered using a dictionary? It would simplify your code considerably. Here's an example: [code] Dim city As New Dictionary(Of String, String) city("AUS") = "Austin" city("BOS") = "Boston" city("BWI") = "Baltimore" city("DFW") = "Dallas" city("JFK") = "New York" city("LAX") = "Los Angeles" city("MIA") … | |
Re: You step through the tree and keep track of the current and previous nodes (I use variables named curr and prev). When you find a node with a value greater than the value of the node you want to insert then you can use the Insert method on the prev … | |
Re: What are "-ve" values? | |
Re: There are a few things wrong here. The first thing is that your function return values do not agree in type with the values you are returning. Let's take [code] Function CommissionTotal() As String commTotal = (commpercentage * grossSales) / 100 Return commTotal End Function [/code] You declared the function … | |
Re: First of all may I suggest that you use the built-in copy methods rather than rolling your own. My.Computer.FileSystem.CopyDirectory(srcefolder,destfolder) will do the copy of the entire folder just fine. That will save you some debugging. If you want to set a folder constant just do Const srceFolder = "D:\MyFolder" To … | |
Re: You could also define a click event for just one of the controls in the set then use AddHandler on form load to add the other controls to that handler. It would save a lot of clicking. You would have to modify the original handler to distinguish between the controls. … | |
Re: What kind of database? What is your level of expertise with databases/VB? Do you mean a process like [code] get username and password from text fields on a form compare to list of valid usernames and passwords from the database if username and password were found in the database let … | |
Re: Please stop posting threads with titles like "Urgent" or "Please Help". These titles are not descriptive. As another poster has pointed out more eloquently than I can, a crisis on your part does not constitute a crisis on mine. We are here to help but when I see a thread … | |
Re: I have two different versions of a command line script that I wrote. The first is written in python and the second in vbscript. The usage is the same for both (pick your poison). archive <folder> where <folder> is the name of the folder that you want to archive. For … | |
Re: Assuming you have data in the given row (in the example, I use row 2 (first row is row zero), you can access all of the cells in that row by [code] For col As Integer = 0 To dgvTest.ColumnCount - 1 MsgBox(dgvTest.Rows(2).Cells(col).Value) Next [/code] | |
Re: What about having one timer for motion and the other for doors. Each tick of the first timer would advance the elevator one unit in whatever direction it happens to be moving (unless the elevator is currently stationary). It would be a state-driven device with states suca as "stationary", "moving", … | |
Re: You have to change "As Date" in your function def to "As Integer" to correspond with the defined type of the variable "Day" or you will get an error. | |
Re: You don't use SaveAs (or even Save) on a WorkSheet. You use it on a WorkBook. For example, the following code copies items from a listview into a new Excel WorkBook/WorkSheet then saves it to a file specified by the SaveFileDialog. [code] 'browse for a file to save the data … | |
Re: Please put CODE tags around code to preserve formatting. After pasting the code, select all code and click on the CODE tool at the top of the edit winidow. We can't help without a few details such as what happens when you try to run this code. What errors do … | |
Re: The following code shows how to create controls at run time. Create a new form and define one button at the top left with the name btnAdd. Paste in the code and give it a try. [code] Imports System.Windows.Forms Public Class Form1 Private xoffset As Integer 'x coordinate of new … | |
Re: It looks like "student info" is two words. You either have to enclode the table name in square brackets to indicate you are doing something weird or rename the table to something like student_info or studentInfo so that it is a single word. The second option (single word) is the … | |
Re: Try [code] Structure league Dim id As String Dim name As String Dim players() As String End Structure Dim leagues(100) As league for i as integer = 0 to 100 redim leagues(i).players(20) next [/code] I don't know why there should be a restriction on declaring the length of the players … | |
Re: You haven't specified the problem. What document file? What merged file? You haven't said what it is you are trying to do. You have no comments or white space in your code, therefore your code is essentially unreadable. Please do a little more work and repost. | |
Re: Assuming you have an Excel file on D: named myfile.xls, you can access it as follows: [code] Dim xls As New Excel.Application Dim sheet As Excel.Worksheet xls.Workbooks.Open("D:\myfile.xls") sheet = xls.Workbooks(1).Worksheets(1) sheet.Cells(1,1) = "abc" sheet.Cells(1,2) = "def" sheet.Cells(1,3) = "ghi" xls.SaveWorkspace() xls.Quit [/code] That will set the first three columns of … | |
Re: "Associating" is a vague term that can mean many things. If you have an array of 52 images and an array of 52 strings (such as "AH 2H 3H..." then the two arrays are "associated" by their indices assuming that the two arrays were defined and loaded such that the … | |
Re: Try this for your connection string for Excel "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" & filename & ";" | |
Re: There have been several postings on this forum relating to accessing Excel spreadsheets from within VB. For example, I recently posted the following code which returns an array containg the names of all worksheets in a given workbook. [code] Private Function GetWorkSheetNames(ByVal ExcelFile As String) As String() Dim names As … | |
Re: I'm curious as to how points are awarded when the OP marks a thread as solved. My control panel states "Forum threads marked solved after Reverend Jim replied to them". What happens in the case when I spend several hours helping a poster with a problem then someone else pops … | |
Re: You have to put some effort into the question 1. What is your program supposed to do 2. What is the actual (observed) result of running your code 3. What error message (if any) do you get 4. What is your database structure 5. What fields (data) are you trying … | |
Re: Or you can download VirtualPC from Microsoft and create a Windows 98 virtual machine inside then for when you want to wax nostalgic. | |
Re: What is the error message that goes with that error number? Do you expect us to look it up just because you are too lazy to type in the eerror text? What line is generating the error? Are we supposed to guess that as well? How are we supposed to … | |
Re: And you won't indent paragraphs with CRLF. You will indent with vbTab. | |
Re: Please post the Input Files info here. When I try to follow your link my anti-virus software says Opening this website may put your security at risk | |
Re: I presume you mean an Excel Workbook/Worksheet. As far as I know you have to open it first but you can do that easily with the following function [code] Private Function GetWorkSheetNames(ByVal ExcelFile As String) As String() Dim names As String = "" Dim xls As New Excel.Application xls.Workbooks.Open(ExcelFile) For … | |
Re: What happens when you go into the device manager (you can run it directly by entering devmgmt.msc in the run menu). Do you have any items with yellow flags? Does anything change when you do "Action -> Scan for Hardware Changes"? Are any of the new devices listed under any … | |
Re: Acronis makes a great backup/restore utility that offers pretty good compression. Image files can be mounted to examine/extract files. | |
Re: Try putting single quotes around '@Password' in line 7. If _userid is also a string then do the same around '@ID' | |
Re: What is the value of connectionInfo? | |
I download a lot of articles for offline reading and archiving. When I download an article, it gets saved as AuthorFirstName AuthorLastName - title.ext Once I have read the article (assuming I want to keep it) I rename it to AuthorLastName, AuthorFirstName - title.ext I wrote a python script (swapnames.pyw) … | |
Re: When you post code, please surround it with code tags. The easiest way is to paste the code, make sure it is all selected, then click the CODE tool at the top of the edit box. The following code iterates over all rows in the datagrid and prints the values … | |
Re: The easiest way would be to create a share on the server and create a shortcut to that share. You don't need an app for that. When the user runs the shortcut, a window opens to C:\temp on the server. Of course, this only works if you are on the … | |
Re: Copy the following code into a file name concat.vbs. To convert your text into a single line do something like concat myfile.txt > temp.txt temp.txt will have one line containing all of the lines in myfile.txt concatenated and separated by a space. If you want to use a different separator … | |
Re: Here is a chunk of "Save As" code from a menu in one of my apps [code] Private Sub mnuSaveAs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSaveAs.Click 'prompt for a file name and save the current library to that file dlgSave.Filter = "Book Library Files|*.bkl|All Files|*.*" dlgSave.DefaultExt = … | |
I have a NumericUpDown control that I want to allow the user to change with the mouse scroll wheel. The problem is that even with the following code [code] Private Sub numSeries_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles numSeries.MouseWheel If e.Delta > 0 Then numSeries.Value += 1 Else … | |
Re: It may be line 82 in your code but we don't know what line in your POSTED code is throwing the error. Please identify the line where it dies. | |
Re: One simplification I could suggest would be to replace the 26 button handlers (for the letters) with one handler for all of them. Below is the code for doing it for three letters. Just add to the end of the function header for more letters. [code] Imports System.Windows.Forms Public Class … | |
| |
Re: If you go to Project -> (my app) Properties There is a checkbox labeled "Make single instance application" Select it if you want to allow only one instance at a time to run, deselect it if you want to be able to run multiple instances. | |
Re: Start by writing out what you want to do step by step (this is called pseudo-code). You should do this before you write any code. Then try to step through your pseudo-code using pencil and paper (for a simple case such as 5 days) to see if your "code" does … | |
Re: It's the same "problem" as the other user who posted a similar "problem". The problem is that you do not understand how computers store and process floating point numbers. The square root function uses a floating point algorithm. The square root of 9 is not (according to the algorithm) exactly … | |
Re: Are you saying you want to create a dropdownlist using the text from a textbox? If so, are you putting one line per list item or one word per list item? Please provide a little more detail. |
The End.