|
How to extract OLE Object from MS-Access Table using visual basic 6 ?
if you have any sample please refer.
also tell me is it possible to identify the OLE Object types (such as word,excel etc...)
|
|
|
|
|
This[^] is about the best anyone can do for you. It's going to take quite a bit of research to find the answer to this problem.
|
|
|
|
|
Hi Everyone -
I created an application that I've sent out to some friends which I thought was pretty flawless... apparently not. Two of the people were using the application for I would say about a week and no problems... then they got the message "Exception has been thrown by the target of an invocation".
I have it pinned down to the Timer that is causing the issue, because the error would pop-up every 30 seconds, and the timers interval is set to 30k ms, so I know that much. Under certain conditions the timer will open up a new instance of a form - which I'm guessing is where the exception is being thrown.
I haven't been able to come across this problem when I'm personally using the application in debug mode, so I don't know what to do.
Also, I was convinced this was a data driven issue, so I asked my friend to send me a copy of the database the application uses, hoping I could replicate the issue for myself - no such luck.
Any advice?
Thanks,
Tommy
|
|
|
|
|
You may receive this exception when you use the Invoke() method (of a form perhaps). The cause of this exception is another exception which occurred inside the method being invoked.
Since you don't know what actually went wrong inside the method that was being invoked, we will need to get the inner exception of the method.
To catch the exception, enclose the line within a try/catch block and get the InnerException.
Sometimes the error might also pop up when the solution file CPU references become corrupt. To check for it, try the following steps:
1: Open the .sln file in notepad
2: Change All References to"AnyCPU" (note the missing space) to "Any CPU"
3: Save
4: Open the solution again.
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
Probable cause may be that your secondary thread (from the time) is attempting to interact with the UI (open a form) this is not recommended. There are various articles in CP discussing these issues.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can you point me to one of the articles? No luck finding one.
|
|
|
|
|
I'm developing a multi-lingual application and ultimately want to use satellite assemblies. The application differentiates between the different *.resx files (using a hub/spoke model) swimmingly but upon converting them to a *.dll I'm overcome with errors. The errors appear are the result of excluding the *.resx files and including the *.dlls in the application. Can anyone help me see the error in my ways? Thanks!
Code forth and prosper...
kIT
|
|
|
|
|
You may want to read this[^] section on Globalization and Localization and how the .NET Framework handles it. It sounds like you're trying to implement your own version of it.
|
|
|
|
|
hi
how can i now in the code wich tab is active
what is the function that tell me
i try focus but it do not give me good result
If TabPage1.Focus() Then
i hope you can help
|
|
|
|
|
Hello,
You can use the 'SelectedTab' or 'SelectedIndex' property for the Tab control to determine the
currently selected tab. You can use either of them. Only difference is that the SelectedIndex
will return the index of the tab page (0 being the starting tab). SelectedTab returns the page.
So you can use me.TabControl1.SelectedTab.Name.
So you can try something like this:
<br />
If Me.TabControl1.SelectedIndex = 0 Then<br />
MsgBox("Page1")<br />
Else<br />
MsgBox("Page2")<br />
End If<br />
I hope this will help.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
thanks it work
|
|
|
|
|
Can someone tell me what I am doing wrong? I am new to VB and am totally lost.
I have created a listbox with a add and multiply button. I have been able to get the add button to add more then 2 numbers but not the multiply button. How do I get the multiply button to multiply 2 or more numbers?
Public Class ArithmeticCalculatorForm
' handles Enter Button Click events
Private Sub enterButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles enterButton.Click
'clears previous results
If resultLabel.Text <> "" Then
resultLabel.Text = ""
operandsListBox.Items.Clear()
End If
'display results in ListBox
operandsListBox.Items.Add(Val(inputTextBox.Text))
inputTextBox.Clear() 'clears results from TextBox
inputTextBox.Focus() 'transfers focus to TextBox
'clears previous results and listbox to enable new entries
If operandsListBox.Items.Count < 2 Then
addButton.Enabled = False
multiplyButton.Enabled = False
End If
If operandsListBox.Items.Count >= 2 Then
addButton.Enabled = True
multiplyButton.Enabled = True
End If
End Sub
Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
Dim total As Integer = 0
Dim operand As Integer = 0
Dim operandCounter As Integer = 0
Dim results As Double = 0
'sums operands in operandsBox
Do
results = operandsListBox.Items.Item(operandCounter)
total += results
operandCounter += 1
Loop While operandCounter < operandsListBox.Items.Count
results = total
resultLabel.Text = String.Format("{0:G}", results)
addButton.Enabled = True
inputTextBox.Focus()
End Sub
Private Sub multiplyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles multiplyButton.Click
Dim total As Integer = 0
Dim operand As Integer = 0
Dim operandCounter As Integer = 1
Dim results As Double = 1
'multiplies operands in operandsBox
Do
results = operandsListBox.Items.Item(operandCounter)
total =* results
operandCounter += 1
Loop While operandCounter < operandsListBox.Items.Count
results = total
resultLabel.Text = String.Format("{0:G}", results)
multiplyButton.Enabled = True
inputTextBox.Focus()
End Sub
End Class ' ArithmeticCalculatorForm
|
|
|
|
|
Is this not a simple mathmatical problem?
You initialise TOTAL to be zero.
Any number * zero will be zero.
Perhaps you should initialise total to be 1 in the multiply routine:
dim total as Integer=1
This should then give a better answer
|
|
|
|
|
Using a Microsoft Access Database, I have an employee table where the social security number is declared as a text field of 9 characters. I have connected the dataset to my VB applicaiton using the dataset wizard.
I have created a form where I am using the MaskedTextBox to display the social security number with the dashes. The problem is that when I try to save the record an error is thrown saying, "Cannot set column 'SS_NO'. The value violates the MaxLength limit of this column."
Do I need to change the size of the social security number in the database to include the dashes ? Will the dashes be stored ?
Have I not bound the control to the dataset correctly ? I dragged the MaskedTextBox onto the form and set the databindings/text field to my employee table.
I'm still new at this. Thanks.
|
|
|
|
|
The problem with using the MaskedTextBox is that it's going to return a String WITH the dashes in it. If your database column is a number or a string with only 9 characters, it's not going to fit. You have to reformat or convert the value to an appropriate length before it goes to your DataTable.
|
|
|
|
|
I made my column wider in the MS-Access database and it seems to be working now.
|
|
|
|
|
I understand your idea that I would need to reformat (or convert) the data to an appropriate length before it goes to my DataTable, but I don't understand where I would perform such a task. Is it an event in the MaskedTextBox ? I'm having a similar problem while using a Combox where the data returned is violating the Emp.Dept field.
Thanks in advance.
|
|
|
|
|
I've written a data entry program for a PDA that is used in my company. The program uses the .NET CF 2.0. The program runs fine, the problem occurs if someone lets the battery die on the PDA. This causes the .NET CF 2.0 to be deleted out of the RAM and then the program can't run unless the .NET CF is reinstalled. What I'm trying to figure out is how to have the program, or another program, reinstall the CF. I've read that the program would have to be written in native code because the CF is not installed. Any idea on how to do this with VS2008 or any ideas on how to fix this problem would be greatly appreciated! Even better would be if someone could help me figure out how to install the .NET CF 2.0 into the ROM, though I couldn't find anything on this. Thanks in advanced.
|
|
|
|
|
Do a clean build of your PDA and perform a full backup onto SD card. If they let their PDA battery die, get them to charge it up and restore from backup. This is the strategy we are using.
-------------------------------------------
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Just bugger off and leave me alone!!
|
|
|
|
|
Thanks. I definitely give that a try.
|
|
|
|
|
I need load my FORM1 and open my FORM2
While my FORM1 is Working...FORM2 is always On TOP
When My FORM2 finish.....FORM2 is closed.
(Form1 fill a ListBox (100 lines is an example))
Somebody help me?
thanks.
my english is bad.
«« Mexico »»
|
|
|
|
|
Help you with what? You haven't explain what part of this you'r having a problem with. And, I don't see anywhere where threading would come into play.
|
|
|
|
|
With Thread-1 I want fill the ListBox and with Thread-2 open
other WinForm and check when Thread-1 finish the work......
I want that 2 Threads is executing in the same time....
Or give me example for use Threads, multithreading, in same time
|
|
|
|
|
opening a second form on a second thread is not a good idea. Since you know nothing of threading at all, I'd avoid the topic entirely because there are some hard-to-debug pitfalls with doing this.
All UI forms and controls should be created and accessed from the UI thread (startup thread). Accessing controls and forms from non-UI threads involving using delegates and invoking methods so those objects are accessed only from the UI thread.
You can find numerous examples with a little Googling. Results for "vb.net threading[^]".
|
|
|
|
|
Dim subtotal As Integer<br />
<br />
With Me<br />
<br />
' Me.Definition_dbDataSet.CUSTOMER_ORDER.fillbyreceipt(Me.txtReceiptNo.Text)<br />
' Me.CUSTOMER_ORDERTableAdapter.Update(Me.Definition_dbDataSet)<br />
Try<br />
Try<br />
subtotal = Decimal.Parse(Sell_unitpriceTextBox.Text) * Me.NumericUpDown1.Value<br />
Me.txtOrderNo.Text = Maxorder.ToString<br />
Me.txtReceiptNo.Text = MaxReceipt.ToString<br />
Me.txtTime.Text = .getdate()<br />
Me.txtTotal.Text = subtotal.ToString<br />
ControlSetting(True)<br />
Catch ex As Exception<br />
MessageBox.Show("Please enter Quantity" & ex.Message, "ERROR")<br />
End Try<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Order_No").Value = Me.txtOrderNo.Text<br />
' Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("TimeDate").Value = Me.txtTime.Text<br />
' Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Stock_Order").Value = Me.Item_NameComboBox.Text<br />
' Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Stock_Qty").Value = Me.NumericUpDown1.Text<br />
'Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Amount_Paid").Value = Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells(3).Value * Sell_unitpriceTextBox.Text<br />
strID = txtReceiptNo.Text<br />
strOrder = txtOrderNo.Text<br />
'txtTime.Text = Format(Date.Today, "dd/MM/yyyy")<br />
Me.CUSTOMER_ORDERTableAdapter.InsertSales(strID, strOrder)<br />
' Me.CUSTOMER_ORDERTableAdapter.UpdateSale(strID, strOrder)<br />
Me.CUSTOMER_ORDERDataGridView.CurrentRow.Cells("Amount_Paid").Value = Me.txtTotal.Text<br />
Me.CUSTOMER_ORDERBindingSource.AddNew()<br />
Me.CUSTOMER_ORDERTableAdapter.Update(Me.Definition_dbDataSet)<br />
Catch ex As Exception<br />
MessageBox.Show("" & ex.Message, "Error", MessageBoxButtons.RetryCancel)<br />
End Try<br />
End With
i having problem that when i choose new detail from combox to datagridview.it's gv me eror.
And i have another question that how i enter new sales in same receipt_no until i end it.without duplicated data. here my query
INSERT INTO [CUSTOMER ORDER]<br />
(Receipt_No, Order_no)<br />
VALUES (?, ?)
UPDATE [CUSTOMER ORDER]<br />
SET Stock_Order = ?, Stock_Qty = ?, TimeDate_Order = ?, Amount_Paid = ?, Item_ID = ?<br />
WHERE ([Receipt_No] = ?) AND ([Order_no] = ?)
i set my receipt and order_no as primary key...can some 1 help me correct it....thanks thanks thanks in advanced
modified on Tuesday, April 15, 2008 8:34 PM
|
|
|
|