|
Hi, I can see that this is your first post here so before posting again I would read the message at the top of this board on how to ask a question. You have supplied way too much code here and because it isn't formatted, some people won't even read it.
With regards to your problem, what I suggest you do is place a break point in your code and step through it, checking the conditions that will result in cmdUpdate0.Enabled equalling false.
|
|
|
|
|
Absolutely noone is going to look through all that code to try and find out what your problem is. You should only post the RELEVANT portions of code, not the entire fricken' project.
|
|
|
|
|
Dave Kreskowiak wrote: Absolutely noone is going to look through all that code
Is that a challenge?
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Not really, but if you felt so inclined, please...far be it from me to hold you back.
|
|
|
|
|
Hi,
I am trying to make a testing solution where in data from an excel sheet gets filled up in a web form displayed on IE.
My solution comprises of an Excel macro.
I am facing a problem in this simple piece of code.When I run the macro I get an error saying
"Method Document of IWebBrowser2 failed"(Run time error-2147467259)
IE version 7.0 is being used....
Dim x As Excel.Worksheet
Dim selRange As Range
Dim ie As Object
Sub Button1_Click()
Set x = ThisWorkbook.ActiveSheet
If ActiveCell Is Nothing Then
MsgBox "No selection made"
Else
Set selRange = ActiveWindow.RangeSelection
End If
Set ie = CreateObject("internetexplorer.Application")
ie.Visible = True
ie.Navigate "http://172.25.103.220/IDS/"
While ie.Busy: Wend
ie.Document.All("txtName").Value = ActiveCell
End Sub
Please help me out....
Thanks.
modified on Friday, August 28, 2009 7:13 AM
|
|
|
|
|
You can't set the value of an document element to an Excel range. You have to provide the VALUE of the cell, not the cell itself.
|
|
|
|
|
Hey,
I really appreciate the point that you made.
Lets say now i replace the ActiveCell by some constant value.I still get the error.I suppose thats because of multiple IE objects which might be open at the time of execution.The tabbed browsing is the icing on the cake!...
Please tell me how to identify the right tab in the right object.
Thanks.
|
|
|
|
|
hi
i have one text box where i have diplay current time
now i have one table in MS-Access and it have lots of records with different times
i want 2 display the price column value in the second text box where the current time matches
here in front of last trade price column i want the price to be display from database,means current time ka price
hope u will understnd wat i m trying 2 ask
thanks
|
|
|
|
|
So what do you need to know? How to get data from an access database? If so, there are plenty of examples both here and on google. If that is not what you want then you need to be clearer with your question.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
i want to know how to write that the sql querry in VB
and how to display the result of that querry in text box
hope u understnd
|
|
|
|
|
So I assume google doesn't work for you, so here you are [^]
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
In my program I am cycling through port numbers starting with COM1 all the way to COM100 to check if my device is hooked up to a com port. I dont think there are 100 Com ports on the pc but I am not sure. Is there a reasonable number that I should cycle up to?
|
|
|
|
|
Hi,
COM ports aren't always called "COMdd", for some of them you can freely choose the name (this requires a driver that allows for it, often the case with USB-to-RS232C cables).
Assuming you are using .NET, I suggest you have a look at SerialPort.GetPortNames().
If you are still considering ancient VB code, you would need help from some Win32 functions, maybe EnumDevices. Have a look here[^] (it is C++ code) and/or search CodeProject or google.
|
|
|
|
|
Hi,
I need to connect to access db on 64bit WinXP machine. I've read that jet provider is not available on 64 machines...., but the exact code runs perfectly in VB6 on the same machine but i cant get it to work in VB.net
here is the .Net code that stops at dbConn.Open() and says {"Provider cannot be found. It may not be properly installed."}
Private Sub FRMOption_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Dim SQL_STR As String
Dim ConnSTR As String
Dim dbConn As ADODB.Connection
Dim rs As ADODB.Recordset
SQL_STR = "select * from TBL_Favorits where FAV_Delete_Bol=false order by FAV_Used_Bol,FAV_Order_Txt,FAV_Oper_Txt"
ConnSTR = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & My.Application.Info.DirectoryPath & "\localFTC.mdb;"
dbConn = New ADODB.Connection
rs = New ADODB.Recordset
dbConn.Mode = ADODB.ConnectModeEnum.adModeRead
dbConn.ConnectionString = ConnSTR
dbConn.Open()
rs.Open(SQL_STR, dbConn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
If Not rs.BOF Then
While Not rs.EOF
ComboBox1.Items.Add(rs.Fields("FAV_Order_Txt").Value & " " & rs.Fields("FAV_Oper_Txt").Value)
rs.MoveNext()
End While
End If
rs.Close()
dbConn.Close()
End Sub
Thanks
Arash
|
|
|
|
|
I think this is what you are missing:
Go to Project Properties
Click on the Compile Tab
Select "All Configurations" in the Configuration drop down
Click the Advanced Compile Options button
In the Advanced Compiler Settings form, set the Target CPU to x86
This compiles the application as a 32 bit program, and when running on a 64 bit machine it should be able to find the provider.
|
|
|
|
|
That was it. thanks for the help now i can simply use the data binding instead of all that.
|
|
|
|
|
The reason why this works is because, like has been stated before, there are no OLEDB drivers in 64-bit. You cannot run both 64 and 32-bit code in the same process. So, since your app was 64-bit, you couldn't use the 32-bit OLEDB drivers to get at the database. That's why your code works when forced to compile as a 32-bit app.
|
|
|
|
|
hey there
I got a visual basic 2008 express version
but the 'Target CPU' option isn't where you said it should be..
anybody know what could be the cause of that?
Thanks
Empathies
|
|
|
|
|
That's because it isn't there in the Express Editions. There is no 64-bit compiler support in the Express Editions, therefore you won't get the option to limit the compiler to 32-bit only code. It's already 32-bit only.
|
|
|
|
|
|
I have same issue but the advanced tab is not available it is there but disabled?
|
|
|
|
|
What version of Visual Studio are you using? Perhaps that feature is not available in the Express version?
|
|
|
|
|
Sorry for the vague title, I guess creativity in describing issues is not my forte.
Brief summary, I have made a Menu control for an application that functions as intended. The menu control has a hierarchy of other controls which is somewhat to complex, but has a great deal of controls. I receive a data table which my menu uses as a data source to add controls to compose the menu of the application, however it takes a great deal of time to construct and there is an issue with drawing. All my controls are in a single FlowLayoutPanel within my Menu control.
The issue is, the order in which I add controls within the FlowLayoutPanel where respected when the FlowLayoutPanel was added during design time. For the issues stated above, I moved my FlowLayoutPanel to be created during run-time, in hopes that my drawing issues will go away if I add all my controls to the FlowLayoutPanel, and then to the Menu control.
For some reason, now the respect in which controls where added to the FlowLayoutPanel are no longer respected, so the ordering of controls are lost. I've debugged all my loops and recursion methods and they are added in the correct order, but the Controls.Item(i to Max) do not list them in that same order.
Is there a reason why, if no algorithms to add the controls where changed, why the FlowLayoutPanel would incorrectly order controls if it placed during design-time over run-time? Why would this behavior change during design time?
If any clarification is needed, please ask.
An example of code is posted below...
first instance of adding a control to the ControlArea of type System.Windows.Forms.ControlLayoutPanel
Me.ControlArea.Controls.Add(MenuButton1)
AddHandler MenuButton1.Click, AddressOf MenuButtonClicked
HeaderLayoutPanel = New System.Windows.Forms.FlowLayoutPanel
HeaderLayoutPanel.Anchor = Windows.Forms.AnchorStyles.Left And Windows.Forms.AnchorStyles.Top And Windows.Forms.AnchorStyles.Right
HeaderLayoutPanel.Width = Me.Width
HeaderLayoutPanel.Height = 0
HeaderLayoutPanel.Margin = New System.Windows.Forms.Padding(0, 0, 0, 0)
HeaderLayoutPanel.Tag = MenuButton1.Tag
second instance
Me.ControlArea.Controls.Add(HeaderLayoutPanel)
Then I have a loop to add a MenuButton, and immediately underneath another FlowLayoutPanel which holds other controls etc.
But in the FlowLayoutPanel, it orders all MenuButtons followed by all FlowLayoutPanels, not respecting the order they where added in.
Any insight is appreciated.
Thank you for the time and the read.
|
|
|
|
|
Hi EliottA,
I have no experience with FlowLayoutPanel, but I have a gut feeling, if I were a FlowLayoutPanel, I wouldn't like my height being set to zero...
|
|
|
|
|
The height is sized accordingly, sorry for leaving the detail out.
All the controls are shown, just not in the order that they where added. The general order is MenuButton followed by a FlowLayoutPanel who's visibility is set to false. When you click that MenuButton, the FlowLayoutPanel's visibility is toggled.
The issue is, despite the way I've added my controls, the z-order index appears to be out of whack and the FlowLayoutPanel is reordering them by itself (See similar issue[^]), also been reported to Microsoft Bug 434674 here[^].
Thanks for the quick reply Luc, it is appreciated.
|
|
|
|