|
My colleague does not use it for 2 way communication, so we cannot confirm or deny whether this functionality is available. However, it may not be necessary. Our approach is to just "send" the label data (ZPL code). The printer has its own print-server logic in it so that if a label is currently being printed it will cause the second label to queue up and wait.
|
|
|
|
|
Thanks for the info and the followup!
|
|
|
|
|
Can any one teach how to a SQL Stored procedure in vb.net 2008 ?
|
|
|
|
|
|
I have vs2005. Someone put together a project for us in vb6, but
when I try to open in vs2005, it converts, but doesnt compile and
I dont really see the source code.
I have projects in vc6 and those will convert to vs2005.
Does vc6 exist? Is there a way of downloading it?
|
|
|
|
|
DanYELL wrote: I have vs2005. Someone put together a project for us in vb6, but
when I try to open in vs2005, it converts, but doesnt compile and
I dont really see the source code.
You cannot compile VB6 code with VS2005. You'll need VS6.
DanYELL wrote: I have projects in vc6 and those will convert to vs2005.
Does vc6 exist?
Yes, Visual C 6 exists, as does Visual Basic 6. What language are your source-projects in? Is it basic or C? If you're coming from Basic, you might want to check out the interop-toolkit from Microsoft, allowing one to mix VB6 and .NET code.
DanYELL wrote: Is there a way of downloading it?
Visual Studio 6 has to be bought, it's not a free product.
Bastard Programmer from Hell
|
|
|
|
|
THe conversion process is not perfect, so it's not guaranteed to work. You should have the source available in the Solution Explorer. If it doesn't show up there, I don't know what's wrong with the project.
Your best bet for converting VB6 to VB.NET is to start rewriting the project by hand. You can use converted code in the new code, but the conversion process adds a bunch of code to maintain backwards compatibility for the VB6 code. Not the best solution. The conversion is there so you don't end up rewriting the entire project from scratch all at once. You can rewrite sections at a time.
|
|
|
|
|
|
Hi,
This is an easy one, I think.
I have written a procedure behind a button e.g.
Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcess.Click
I want to call this procedure from a timer function, how is this done?
Thanks in advance.
|
|
|
|
|
How would you call any subroutine?
The best things in life are not things.
|
|
|
|
|
1.
why would you put code in a button click handler, if what you want is have it executed by a timer tick handler?
2.
you can simulate a button being clicked by calling Button.PerformClick
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
You don't put the code in the Button Click event handler. You put code in its own Sub, then call it from the Button Click handler and the Timer Tick event handler.
|
|
|
|
|
just call btnProcess.PerformClick() in timer.tick event.
or
btnProcess_Click(sender, nothing) in timer.tick event.
|
|
|
|
|
That's the very wrong way to do it. It's lazy and leads to other possible issues that can't be traced down easily.
If there is code that needs to be executed from multiple places you stick it in its own method with a name that has meaning as to what the code does. You don't "hide" it inside an event handler.
|
|
|
|
|
its up to the developer to decide... and ofcourse the one who asked this question knows how to move all the statements in the button's click event to a sub-routine and call the same sub-routine in the button's click event. its that simple..let them do in their own way. can you describe why it is wrong way?
|
|
|
|
|
|
<br />
Option Explicit<br />
Dim DB As ADODB.connection<br />
Dim strString As String<br />
Dim rs As ADODB.recordset<br />
Dim cs As ADODB.connection<br />
Dim ks As ADODB.recordset<br />
Private Const CB_SHOWDROPDOWN As Long = &H14F<br />
Private Const CB_GETDROPPEDSTATE As Long = &H157<br />
Private Drop As Boolean<br />
Private Const CB_FINDSTRING = &H14C<br />
Private Const CB_SELECTSTRING = &H14D<br />
Private Const CB_LIMITTEXT = &H141<br />
Private Const CB_ERR = (-1)<br />
Private Sub db_conn()<br />
Set DB = New ADODB.connection<br />
<br />
DB.CursorLocation = adUseClient<br />
<br />
DB.Open "PROVIDER = Microsoft.Jet.OLEDB.4.0;Data Source =" & App.Path & "\Medrar.mdb;"<br />
End Sub<br />
Private Sub cmdAcchu_Click()<br />
Dim obj, rs As ADODB.recordset, SQL As String<br />
<br />
Set rs = New ADODB.recordset<br />
<br />
<br />
Set rs = New ADODB.recordset<br />
strString = " SELECT cusname,idnumb,mobi,pron,proc,blkno,lannum,sqland,cost,comiso,addit,deduc,gtot,vali,rename" & _<br />
" From reser" & _<br />
" WHERE reno = '" & Combo1.Text & "' "<br />
<br />
<br />
rs.Open strString, DB, adOpenStatic<br />
' Set rs = db.Execute(strString)<br />
'With reportPS<br />
If Not rs.EOF Then<br />
Set Reservation.DataSource = rs.DataSource<br />
<br />
<br />
'-----------------------------------------------------------------------------------------------'<br />
'PageHeader<br />
Reservation.Sections("PageHeader").Controls("lblcusname").Caption = CStr(rs!cusname)<br />
Reservation.Sections("PageHeader").Controls("lblidnumber").Caption = CStr(rs!idnumb)<br />
Reservation.Sections("PageHeader").Controls("lblmobile").Caption = CStr(rs!mobi)<br />
Reservation.Sections("PageHeader").Controls("lblPron").Caption = CStr(rs!pron)<br />
Reservation.Sections("PageHeader").Controls("lblProc").Caption = CStr(rs!proc)<br />
Reservation.Sections("PageHeader").Controls("lblBlkno").Caption = CStr(rs!blkno)<br />
Reservation.Sections("PageHeader").Controls("lblLn").Caption = CStr(rs!lannum)<br />
Reservation.Sections("PageHeader").Controls("lblsql").Caption = CStr(rs!sqland)<br />
Reservation.Sections("PageHeader").Controls("lblcost").Caption = CStr(rs!cost)<br />
Reservation.Sections("PageHeader").Controls("lbCommi").Caption = CStr(rs!comiso)<br />
Reservation.Sections("PageHeader").Controls("lblAdd").Caption = CStr(rs!Addit)<br />
Reservation.Sections("PageHeader").Controls("lblDed").Caption = CStr(rs!deduc)<br />
Reservation.Sections("PageHeader").Controls("lblGt").Caption = CStr(rs!Gtot)<br />
Reservation.Sections("PageHeader").Controls("lblVali").Caption = CStr(rs!vali)<br />
Reservation.Sections("PageHeader").Controls("lblrname").Caption = CStr(rs!rename)<br />
Reservation.Sections("PageHeader").Controls("lblcname").Caption = CStr(rs!cusname)<br />
Reservation.Sections("PageHeader").Controls("lblvali1").Caption = CStr(rs!vali)<br />
'-----------------------------------------------------------------------------------------------'<br />
<br />
<br />
Reservation.Refresh<br />
Reservation.Show vbModal<br />
<br />
<br />
End If<br />
'End With<br />
<br />
<br />
'For Each obj In reportPS.Sections("PageHeaders").Controls<br />
' If TypeOf obj Is RptTextBox Then<br />
' obj.DataMember = rs.DataMember<br />
<br />
'End If<br />
'Next<br />
<br />
<br />
End Sub<br />
Private Sub cmdbye_Click()<br />
Unload FrmResPrnt<br />
End Sub<br />
Private Sub Combo1_Click()<br />
Dim cnemployee As New ADODB.connection<br />
Dim rsemployee As New ADODB.recordset<br />
<br />
Call connection(cnemployee, App.Path & "\Medrar.mdb", "endromida")<br />
Call recordset(rsemployee, cnemployee, "SELECT * FROM Reser WHERE Reno ='" & Combo1.Text & "'")<br />
<br />
If rsemployee.RecordCount = 0 Then<br />
MsgBox "The record you requested could not be found.", vbExclamation, "Medrar"<br />
Exit Sub<br />
End If<br />
<br />
With rsemployee<br />
<br />
<br />
End With<br />
<br />
Set cnemployee = Nothing<br />
Set rsemployee = Nothing<br />
End Sub<br />
Private Sub Combo1_KeyPress(KeyAscii As Integer)<br />
Dim t$, rez&, l&<br />
Combo1.SelText = ""<br />
t$ = Combo1.Text & Chr$(KeyAscii)<br />
rez& = SendMessage(Combo1.hwnd, CB_FINDSTRING, -1, ByVal t$)<br />
If rez& <> CB_ERR Then<br />
l& = Len(t$)<br />
Combo1.Text = Combo1.list(rez&)<br />
Combo1.ListIndex = rez&<br />
KeyAscii = 0<br />
Combo1.SelStart = l&<br />
Combo1.SelLength = Len(Combo1.Text) - l&<br />
End If<br />
Dropdown<br />
End Sub<br />
Private Sub Combo1_LostFocus()<br />
Dim t$, rez&<br />
t$ = Combo1.Text<br />
rez& = SendMessage(Combo1.hwnd, CB_FINDSTRING, -1, ByVal t$)<br />
End Sub<br />
Private Sub Dropdown()<br />
If Drop Then<br />
If SendMessage(Combo1.hwnd, CB_GETDROPPEDSTATE, 0, ByVal 0&) = 0 Then<br />
Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, 1&, 0&)<br />
End If<br />
End If<br />
End Sub<br />
Private Sub res()<br />
Set cs = CreateObject("Adodb.connection")<br />
cs.Provider = "Microsoft.jet.oledb.4.0"<br />
cs.Open App.Path & "\Medrar.mdb"<br />
Set ks = New ADODB.recordset<br />
ks.Open "Select reno from reser", cs, adOpenKeyset, adLockOptimistic<br />
While Not ks.EOF<br />
Combo1.AddItem ks.Fields("Reno")<br />
ks.MoveNext<br />
Wend<br />
ks.Close<br />
Set ks = Nothing<br />
Drop = True<br />
End Sub<br />
Private Sub Form_Load()<br />
Call res<br />
End Sub<br />
<br />
Run Time Error:3709
|
|
|
|
|
please read my sig.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Maybe this[^] will help you... or even us.
|
|
|
|
|
First, you'll have to find out what's causing the error; Knowledge Base[^]
Next, you fix it
Bastard Programmer from Hell
|
|
|
|
|
Are there no bounds to your wisdom at all?
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
MY GOD MAN! HOW DARE YOU SEARCH THE SACRED KNOWLEDGE BASE!
Stay away from me. I don't want to get hit by the lightning that's coming for you.
|
|
|
|
|
|
Hi,
I get the following message when I try and delete a file.
"System.IO.IOException - The process cannot access the file 'filename' because it is being used by another process."
My cut down code is as follows
Dim aryFi As IO.FileInfo() = diFolder.GetFiles("*.pdf")
For Each fi In aryFi
sFileName = fi.Name
fi.delete
Next
Basically what I am doing is that depending what file is in the folder, delete it once I get various information about it that file. The above code is a cut down version. What other way would you delete a file or is this the best way. If so, what am I doing wrong.
Thanks in advance.
modified on Wednesday, May 25, 2011 8:30 AM
|
|
|
|
|
The "other process" still has the file open. There's no way to delete it until the other process closes the file.
You could force it closed using some hacked techniques, but that'll only crash the other process that still has it open.
|
|
|
|