|
Set IgnoreRemoteRequets to True to force excel to open a new instance of excel.exe for each workbook, this may cause undesired behavior and may cause links to not work. Save your sheet when you set ignoreremoterequests to true.
This will prevent all worksheets opened programtically when a user opens a workbook from his desktop.
|
|
|
|
|
I have a DatagridView with 10-columns and Allow user to add new row is True.
But the problem is when the user entering the data's in new row's from the last row, when they
entered the data in 4th cell, they like to save the data.
But it's not saving, the uncompleted last row.
Iam using the following for save.
-----------------------------------------------------------
Dim DAD31 As SqlDataAdapter,DS31 As New DataSet,DTB31 As New DataTable
Dim Save_4 As String = "insert into itemmst (itm_description) values (&itm_description)"
DAD31.InsertCommand = New SqlCommand(Save_4, con)
con.Open()
Dim Trans As SqlTransaction
Trans = con.BeginTransaction
DAD31.InsertCommand.Transaction = Trans
Try
DAD31.Update(DS31.Tables(0))
Trans.Commit()
Catch ex As Exception
If Not Trans Is Nothing Then
Trans.Rollback()
End If
MsgBox(ex.Message)
End Try
con.Close()
----------------------------------------------------------------
THANK YOU ! For Your Valuable Minutes !!!
|
|
|
|
|
You shouldn't be using a DataGridView for data entry, but, that's up to you.
What IS it doing? Are there any exceptions?? Your code snippet is swallowing them, hiding them from you. This is, obviously, really bad practice. You should be doing something with the exceptions that will show you what they are.
|
|
|
|
|
Hi
I am using VB 6.0. I am working on an application involving Com port.
I need to send messages to com port continously and when I recieve data from the other end i need to perform another action. So I should put the data to be sent in a queue and when I recieve response from the other end I should remove first element in the queue and process that.
using queues is an appropriate one. I can't use .NET now. In .NET it's very simple using System.Collections.Queue.
Thanks in advance
|
|
|
|
|
Member 3057887 wrote: I am using VB 6.0.
Why would you do such a thing ? Have you lost a bet ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi
Thanks for replying so soon
I did not bet at all. The application is already developed in Vb 6.0. To convert it into .NET it takes some time. But we dont have much time as we have demo tomorow.
|
|
|
|
|
There is no threading support in VB6. For a workaround (if you port your app to .NET later) I would try something with a timer control, that pools your serial. Thats NOT good practice, but probably a quick and dirty way...
Regards: Didi
|
|
|
|
|
I'm trying to do the same. All I need is how to implement queues in vb 6.0. Is there any way like System.Collections.Queue in .NET. I want to put all the messages to be sent into a queue. when the comport receives response from the other end I will take out the first element in the queue and use that.
regards
|
|
|
|
|
There is no explcit queue. You could use an array instead.
Good luck with your demo tomorow: Didi
|
|
|
|
|
Hi
thanks a lot. array size is fixed. if i use redim it is intializing every time. the code should be in such a way that when the timer fires
the msg to be sent should be appended to the list of previous msgs.
regards
|
|
|
|
|
...use ReDim Preserve and it will not reinitialze. Regards: Didi
|
|
|
|
|
ReDim Preserve is a painful solution, the memory usage is nasty as you need to have allocated both the old and new memory at the same time.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Yes, you are right, but we were talking about a dirty easy solution to save a presetation appointment tomorow. The guy is going to port the solution to .NET later. I never saied that this is good programming practice.
Regards: Didi
|
|
|
|
|
I've seen so much 'quick and dirty for a demo' go into production code that I avoid it like the plague.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
There are collections in VB6, try:
Option Explicit
Private queue As Collection
Private Sub Class_Initialize()
Set queue = New Collection
End Sub
Public Sub Enqueue(newItem As String)
queue.Add newItem
End Sub
Public Function Dequeue() As String
Dim ret As String
ret = queue.item(1)
queue.Remove 1
Dequeue = ret
End Function
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Zing!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hello All,
I have a question about Antivirus. How the antivirus work. how the antivirus check this exe have these function which can effect on data.
Because Exe is created in Encoded form.
Thanks
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: Because Exe is created in Encoded form.
What ?
Seriously, I don't know why you ask this. If you want to write an antivirus, forget it, you don't appear to come close to knowing enough to do that.
If you want to write a virus, thankfully, that is plainly beyond you, also.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I want to Know about antivirus functionality ?
Can u discribe or not?
If you can think then I Can.
|
|
|
|
|
And what would this have to do with VB. I know you have the wrong forum I think you may even have the wrong site.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Is MFC VC++ is suitable for it? I am not trying to write code for Antivirus or Virus. My purpose is finding Logic for behind of ANTIVIRUS Functionality.
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: My purpose is finding Logic for behind of ANTIVIRUS Functionality
Then read some of the white papers available from the various vendors, that what they are for clickety[^]
Your question about the relevance of a language to the logic does not make sense.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
eg_Anubhava wrote: am not trying to write code for Antivirus or Virus
Then you're in the wrong place.
eg_Anubhava wrote: My purpose is finding Logic for behind of ANTIVIRUS Functionality.
If you're not writing an antivirus, I can only assume you're writing a virus.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I thin u have not answare of my question?
You are only wasting of my time.
If you can think then I Can.
|
|
|
|
|
...no you are wasting there time...
Regards: Didi
|
|
|
|