Wednesday, 28 June 2006
|
| who work's with Visual Basic 2005? Guest 19:56:07 |
| | I need the code for change focus!
|
| | 1 answer | Add comment |
|
| Screen.Width Dan 17:34:52 |
| | I have a form and want to center some controls in the middle of the screen... It all works fine except that sometimes for no aparent reason the screen.width changes... When it is actually centered in my screen the screen.width is 15360 and when it is off to the right the screen.width is 11520. For the life of me I can find no reason why it would do this.
Any help is greatly appreciated!
Dan
|
| | 3 answer | Add comment |
|
| Problem Connecting to MS Access Database Hplayer03 11:46:51 |
| | I'm fairly new to VB and was wondering what the connection string for an ADODB.Connection looks like that will open an Access Database with a password???? Thanks!!!!
what i have looks like this....
dim localdb as new ADODB.Connection localdb.Provider = "Microsoft.Jet.OLEDB.4.0" localdb.Properties("Data Source") = "c:\test.mdb" localdb.Properties("DefaultUser") = "admin" localdb.Properties("Jet OLEDB:Database Password") = "mypass" localdb.CursorLocation = adUseClient localdb.Open
the error i get says "Item cannot be found in the collection corresponding to the requested name or ordinal"
|
| | 4 answer | Add comment |
|
| MSFlexGrid control Jim Y 11:44:16 |
| | In VB6 I have a MSFlexGrid displaying records from a database using both vertical and horizontal scroll bars to show all details. Each record row is quite wide, about 26000 twips or almost three times the width of the grid on the screen.
If I manually scroll to the right to see the data at the far right of a record, then close the window without scrolling back to the left, when I reopen the window the display is showing the far right of the records where it was before closing. Is there code that I can add to cause the display to return to the far left of the grid data when the window is opened/closed?
Thank you, Jim Y
|
| | 28 answers | Add comment |
|
| Visual Basic Input Vballmatt 07:32:22 |
| | I've got this piece of code.
Input #1, modMain.cSettings.correctionFactor
I am inputting a Double. modMain is a module, cSettings is an instance of a class I created, and correctionFactor is a member variable of cSettings, type double. When I try to execute this command, I get the error:
Compile error: Variable required - can't assign to this expression
I think that it has to do with the fact that I have somehow not defined the correctionFactor yet, so it doesn't view this as a variable. If anyone's got some help, I'd really appreciate it.
vballmatt
|
| | 1 answer | Add comment |
|
| detecting word type in sentence Guest 04:19:48 |
| | I want to feed a sentence (or paragraph) into a rtf or text box, then be able to detect what type of word each word is. ie noun, verb, adjective, adverb, preposition, conjunction, etc. Is there a way to tap into the word grammar api and get this data. Is there any markov code to tell me this?
Thanks in advance,
blbling
|
| | Add comment |
Tuesday, 27 June 2006
|
| Loading two different registry hives Jerry West 12:39:43 |
| | Is it possible to load HKU and HKLM at the same time? I'm accessing the registry of a computer over the network. I can load one or the other hive just fine on the remote system. But if I try to load both, i.e. one is loaded already and then I attempt to load another I get an error back from RegLoadKey indicating 32. This error advises that the process cannot be completed because another process is using it.
Anyone know about this?
Thanks,
JW
|
| | 1 answer | Add comment |
|
| Using keys on the numeric keypad to initiate macros Jmgross@Optusnet.Com.Au 12:36:28 |
| | I would very much like to be able to use certain keys on the numeric keypad to run macros.
I have tried to do this with the Application.OnKey method, but it doesn't seem to work for the keys I would like to use (specifically, the + key and the 'period' or 'decimal point' key on the numeric keypad. When I specify either "+" or "." as the first argument to the OnKey method, the macro runs fine if I press the '+' key on the main keyboard (Shift/=) or the 'period' key on the main keyboard; but when I press the "same" key on the numeric keypad, the macro does not run and the "+" or "." simply appear in the active cell.
Does anyone know of a way to do what I want?
|
| | 5 answers | Add comment |
|
| Maximum number of DLL calls Modelsolutions 02:14:13 |
| | Is there a maximum number of times you can call DLL from VB?
I am trying to call a dll 1000 times in a loop and it crashes around 985.
LoadLibrary (...\mylib.dll} For i=1 to 1000 Call mylib(...pars) Next i FreeLibrary
It does not make it through this loop and it does not give an error message.
|
| | 3 answer | Add comment |
Monday, 26 June 2006
|
| Toolbar wizard - remove a button added from .ico file Qwest12345@Hotmail.Com 20:36:05 |
| | Once you have added your own button to the toolbar wizard (from a .ico file), how do you remove it (from the left hand side of the wizard) when you have an improved version?
|
| | Add comment |
|
| Sending Input to Webpages from VB Iraket 16:43:55 |
| | Hi all,
In my continuing slow push to learn VB I've come across another problem I could use some guidance on.
Basically, I want to be able to send a userid, and password to a webpage and then have VB hit the submit button. The userid and password will be stored in 2 text boxes. I would like VB to then display the page directly after hitting submit.
Through some searching here I found some help and it looks like if I create a winsock control on the form I can utitlize the .sendata command to get the text into the boxes, but how do I simulate the submit button? I'm guessing thats within the senddata function?
Also - this may be a dumb question but how would I display this on a new form? I know I can actually add a webbrowser form, but will the winsock control return a value for me to place in the browsers address?
Anyway, you all have been so much help in the past, thanks for continuing to bare with me. Code I was looking at below:
Private Sub Winsock1_Connect() Dim SendString As String SendString = "POST /scripts/user=new HTTP/1.1" & vbLf & _ "Accept: */*" & vbLf & _ "Referer: blank" & vbLf & _ "Accept -Language: en -us" & vbLf & _ "Content-Type: blank" & vbLf & _ "Accept -Encoding: gzip , deflate" & vbLf & _ "User-Agent: blank" & vbLf & _ "Host: blank" & vbLf & _ "Content-Length: " & CStr(Len("Userid=" & Text1.Text & "&Password=" & Text2.Text)) & vbLf & _ "Connection: Keep -Alive" & vbLf & vbLf & _ "Userid=" & Text1.Text & "&Password=" & Text2.Text
Winsock1.SendData SendString End Sub
The webpage boxes are id's like:
<input type="text" name="username" <input type="password" name="password"
The submit button like:
<input type="submit" value="Login">
|
| | 4 answer | Add comment |
|
| More difficult question - how do I wait until another application closes? New User 12:16:50 |
| | Now I have a Shell command which runs a program EasyBMPtoAVI.exe in another window (MS-DOS window). That thing typically takes 2 to 100 seconds to complete the run. After that I should delete a lot of files I create in Visual Basic for EasyBMPtoAVI to process and combine.
How do I make VB watch for EasyBMPtoAVI to finish its task, after which the code can continue with Kill Image*.bmp and inform me that the AVI is ready? For the time being, I put a MsgBox command saying MsgBox "Click OK after EasyBMPtoAVI has completed its task". So once I click that, the code continues with deleting the myriad bmp's. It would be nice to do it without the user's involvement, if the code for that is not complicated.
Ideally, I would like to even zip the huge AVI files this thing is creating.
|
| | 5 answers | Add comment |
Sunday, 25 June 2006
|
| can't figure this code out Guest 21:49:16 |
| | someone can tell me how x2 becomes 512
Dim x As New BitArray(1024) Dim x2(31) As Integer x.Set(9, True) x.CopyTo(x2, 0) Console.WriteLine(x2(0)) => 512
|
| | 1 answer | Add comment |
|
| Are ActiveX Errors Handled Like VB Errors? Greg@gmail.com 08:32:00 |
| | I have a program that goes out to a web site and works fine as long as all the objects are there. When an object is not there, I get:
Runtime error '429': ActiveX Component Can't Create Object
Why doesn't this code trap the error?
Private Sub GetBills() On Error GoTo ExecuteError
blah, blah
Exit Sub
ExecuteError: txtNotes.Text = txtNotes.Text & vbCrLf & _ "Error executing command in cmdSelectClient_Click" & _ vbCrLf & Err.Description End Sub
The only thing I can figure is that an ActiveX component doesn't know that it is being used by VB and so has to do its own error handling.
Thank you.
|
| | 1 answer | Add comment |
Saturday, 24 June 2006
|
| Reading/Writing to a txt file in VB Iraket 18:17:20 |
| | Hi all,
I'm very new to VB and am attempting to create a VB program that will read and write to a text file. I had thought I had it all working yesterday, but realized today there is a problem. The code that I will copy below works if there is no folder created, but bombs out if the folder is created and one of the text files is missing. I can get the print functions to work with no problems once the txt files and everything are already there.
Basically, there will never be more then 7 line of text. I'm trying to get the program to create the folder and the text files if they are not there, and if they are there read in the existing contents into text boxes.
Below is the code:
private sub form_load()
filepath = "c:\program files\txtreader\test1.txt" filepath2 = "c:\program files\txtreader\test2.txt"
On Error GoTo 10 Open filepath For Append As #1 Input #1, pmcd txt1.Text = pmcd Input #1, pmcd txt2.Text = pmcd Input #1, pmcd txt3.Text = pmcd Input #1, pmcd txt4.Text = pmcd Input #1, pmcd txt5.Text = pmcd Input #1, pmcd txt6.Text = pmcd Input #1, pmcd txt7.Text = pmcd Close #1
Open filepath2 For Append As #1 Input #1, umcd txt8.Text = umcd Input #1, umcd txt9.Text = umcd Input #1, umcd txt10.Text = umcd Input #1, umcd txt11.Text = umcd Input #1, umcd txt12.Text = umcd Input #1, umcd txt13.Text = umcd Input #1, umcd txt14.Text = umcd Close #1 Exit Sub
10
MkDir ("c:\program files\txtreader\")
End Sub
----
The text file's are set up 7 lines each. For example:
hello how are you today have a good day
Thanks for any help you all can provide!
|
| | 3 answer | Add comment |
|
| A urgent doubt Anbulla Aswin 18:01:16 |
| | How to save the filenames inside a user specified folder into a access table? I need the coding urgent. plz help.
|
| | 1 answer | Add comment |
|
| My VB query Anbulla Aswin 17:58:26 |
| | How to save the names of the files of an user specified folder into an access table? i neeed the coding very urg. plz help.
|
| | 1 answer | Add comment |
|
| how to edit data of a particular column in MSFlex Grid Raman 10:03:11 |
| | Hi All, how do i edit data of a particular column in MSFlex Grid? i know i can do it with text box but was wondering if i will be able to edit data in a specific column... Please do help. Thanks Anu
|
| | 4 answer | Add comment |
|
| Checkbox & Option Button Colours Tony McGee 06:05:22 |
| | Hello Rick
Thanks for the reply. Had a sudden thought (I don't have many of them).
I was running VB with a manifest file (VB6.exe.manifest)
I temporarilary renamed the manifest file to remove it from the equation, & presto, my code works.
Now, where does this leave me. Users these days want not only a program that works, but a pretty look & feel.
I can now change the colours of my text for these controls, but they no longer have the XP look about them.
Yes, I know, why change the text colour. but just another option I was giving users.
I have a modlue level routine which is called from every form to set a lot of control properties & look & feel stuff based upon what the user has specified in a preferences screen.
I additionally use this routine to set all data input fields based upon their name (ie abnum2AMT is number field with 2 decimal places, abpct4AR is a percentage field with 4 decimal places etc)
I just name the controls according to my requirements & then have the one routine set all of the properties etc I require without having to set any properties on the control itself.
Regards Tony McGee
|
| | 2 answer | Add comment |
Friday, 23 June 2006
|
| Common Dialog Dan Shelby 21:03:51 |
| | My toolbox doesn't contain a common dialog in VB6. How do I get this to be added to the toolbox?
|
| | 30 answers | Add comment |
|
| Off topic - Easter egg in VB6 ? Ade 18:26:39 |
| | Hi,
I came across this when looking for some game information...
http://www.eeggs.com/items/41560.html
I haven't tried it because I'm not too sure on how to go about it.
Ade
|
| | Add comment |
|
| Rich Text Box Spider 18:23:53 |
| | Is there a way to prevent anything other than text being entered into a rich text box? My program can be made to lock-up at times when other objects are pasted into the text box. -- Spider
|
| | 12 answers | Add comment |
|
| CheckBox & Option Button text colour Tony McGee 14:40:11 |
| | I do not appear to be able to change the colour of the text (foreground) colour for the standard VB checkbox & option button.
I would like to be able to do this in code (VB 6, SP5)
Is this possible? Any help would be appreciated.
Thanks Tony McGee
|
| | 4 answer | Add comment |
|
| Passing Arrays to Functions Michael Powe 10:31:45 |
| | Hello,
I am having a problem with passing an array into a function call.
8<-------------------------------------------------->8 In ClassA, I have a function declared like this: Private arrUserValues() as String
Public Function CreateQuery(ByRef arrUserValues()) As String Dim QueryString as String ' [ ... ] ' a bunch of stuff done here
CreateQuery = QueryString End Function
8<-------------------------------------------------->8 in ClassB, I call the function like this:
Private arrUserValues() as String Private oParseData as New ParseData
Private Function Translate() as Long Dim NewString as String NewString = oParseData.CreateQuery(arrUserValues()) ' [ ... ] End Function 8<-------------------------------------------------->8
The "NewString" line calling the CreateQuery function generates a "type mismatch: array or user-defined type expected", with arrUserValues highlighted. I've dicked around 20 different ways with this function call, without success. I'm not a VB programmer by trade, I do this stuff a half-dozen times a year, so I'm pretty ignorant, I'm afraid, of the trade secrets.
The other relevant fact is that when entering that line, intellisense shows the CreateQuery parameter list as "(arrUserValues() as Variant)" even though it is explicitly declared as type "String" in ClassA.
The function definition definitely takes an array dimensioned as a dynamic array of strings. The function call definitely is being made with a dynamic array of strings.
I really need help getting sorted out with this. What do I need to do to pass in my array of string values and parse it?
Thanks.
mp
-- 'cat' is not recognized as an internal or external command, operable program or batch file.
|
| | 3 answer | Add comment |
|