|
We can keep no problem ,its not the original issue after succesfully login what code i have to write to show MDI form, and what i have to do this login form ?
|
|
|
|
|
It's not the problem, it's just really bad code.
I don't get it - this code looks like it will show your MDI form, so what is the question ? Does this not work yet ? Is there no actual login form ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
See i have to keep frmLogin as SatrtUp object am i right?
if i keep Login as StartUp and after successfully login i have to show MDI form to the user.Its happening but what i have i do that Login form? because its already opened and there only we called MDI.
|
|
|
|
|
You could use
Sub Main()
Dim frmL as New frmLogin
Dim frmM as new frmMDI
Application.Run(frmL)'run login form
Application.Run(frmM)'run MDI form
End Sub
|
|
|
|
|
Please How to send info out the lpt port(Write)??
|
|
|
|
|
|
Hi,
I'd like to let my program respond if the ENTER key is pressed. I tried windows.forms.keys.enter but i just can't let it work. Error messages keep showing up or the program doesn't respond at all. I want to let the program respond with ComboBox1_KeyPress (and then the enter key)
--Zaegra--
|
|
|
|
|
Zaegra wrote: Error messages keep showing up or the program doesn't respond at all.
Sounds like you need to post the code and the errors you are getting
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Zaegra,
You need to turn on the keypreview property of the form to react to a form wide return key stroke. otherwise you have to add a kepress event on every control reacting to the return key.
Private Sub Form_KeyUp(ByVal sender As Object, ByVal e As system.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Windows.Forms.Keys.Return Then
'do whatever
End If
End Sub
nathan
|
|
|
|
|
Use the KeyDown Event (or any event that uses System.Windows.Forms.KeyEventArgs )
|
|
|
|
|
Thanks guys
--Zaegra--
|
|
|
|
|
hi,
how can i put a Progressbar in myproject to show the progress of a database operation.
i put one ,but it is not working simultaneously with the dataaccess
can anybody help me
|
|
|
|
|
Did you expect it to work by magic ? It will show progress based on how you set it. If you're calling a database, it cannot show progress, as the activity is atomic - the first you know about it is when the call has returned.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Add Reference: Microsoft ActiveX Data Object 2.8
Public Function GetEmployeesData() As Boolean
Dim iMaxEmp As Integer
Dim cn As New ADODB.Connection
Dim rstEmp As ADODB.Recordset
Dim iCounter As Integer
On Error GoTo EmpError
cn.Open "Database Connection", "username", "pwd"
Set rstEmp = Server.CreateObject("ADODB.RecordSet")
'USER FEEDBACK
frmMain.lblStatus = "Now Processing Employees Information"
frmMain.ProgBar.Value = 0
frmMain.ProgBar.Visible = True
iMaxEmp = rstEmp.MaxRecords
frmMain.ProgBar.Max = iMaxEmp
iCounter = 0
While Not rstEmp.EOF
sName = Trim(rstEmp!Name)
sAddr1 = Trim(rstEmp!Addr1)
sAddr2 = Trim(rstEmp!Addr2)
sAddr3 = Trim(rstEmp!City)
sAddr4 = Trim(rstEmp!Code)
iCounter = iCounter + 1
frmMain.ProgBar.Value = iCounter
rstEmp.MoveNext
Wend
frmMain.ProgBar.Visible = False
frmMain.ProgBar.Value = 0
frmMain.lblStatus = "Employees Information processed succesfully"
Exit Function
EmpError:
MsgBox "An Error Occured: " & Err.Description, vbCritical, "Warning"
Err.Clear
End Function
If using VB 6.0 don't forget to add the Progress Bar control on the form.
Hope this helps.
|
|
|
|
|
Unless you update each individual record yourself, you can't do what you want. The database calls don't report back any progress so there is nothing you can use to display in your ProgressBar.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi all
i want to develop a windows service in which the application will run at the back end when the system starts..
i ve vs.net 2003 and windows xp professional version 2002 service pack 2 in my system..
can it be possible....???
any help in this regard will be highly appreciated..
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
Yes, of course it's possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Of course it's possible. All you have to do is create a Windows Service project and code the thing correctly.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to send an email through vb6.0 coding.
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
|
'Developed by: Vusi Nsibande
'Send Mail using VB in Lotus Notes
'Reference to : Lotus Domino Objects
'***********************************
'Notes variables
Dim dbDir As NotesDbDirectory
Dim n_Session As New NotesSession
Dim ndb_MailFile As NotesDatabase
Dim ndoc_Memo As NotesDocument
Dim ndoc_Col As NotesDocumentCollection
Dim nrtf_ItmBody As NotesRichTextItem
'VB strings
Dim strErr As String
Dim SendTo As String
Dim m_Subject As String
Dim m_Body As String
Dim m_attachment As String
Dim pwd As String
Dim Pos As Integer
Dim attDir As String
Dim AttPathOnly As String
Private Sub cmdLogin_Click()
On Error GoTo ErrorHandler
pwd = txtPass.Text
If pwd = "" Then
MsgBox "Please enter your e-mail password", 48, "Password required"
Exit Sub
End If
' Put your password in the quotes below to skip prompting
n_Session.Initialize (pwd)
' Either SendTo, CopyTo, or BlindCopyTo is required.
If (txEmail.Text = "") Then
MsgBox "Recipient e-mail address is required", 48, "Address required"
Exit Sub
End If
Set dbDir = n_Session.GetDbDirectory("\\MailServer\") '("C:\Lotus\Notes\Data\")
Set ndb_MailFile = dbDir.OpenMailDatabase()
' Generate an error if previous attempts were unsuccessful.
If ndb_MailFile Is Nothing Then
MsgBox ("Mail file not open"), 48, "Invalid file"
Exit Sub
End If
Dim NFiles As Integer
Dim Path As String
Dim OutFiles As Variant
Set ndoc_Col = ndb_MailFile.UnprocessedDocuments
Set nDoc = Collection.GetFirstDocument
Path = "C:\Detached\"
OutFiles = ""
NFiles = GetAllAttachments(Doc, Path, OutFiles)
SendTo = txEmail.Text
m_Subject = "Mail from Notes Using VB6.0"
' Create a new memo document.
Set ndoc_Memo = ndb_MailFile.CreateDocument
Call ndoc_Memo.AppendItemValue("Form", "Memo")
Call ndoc_Memo.AppendItemValue("From", n_Session.CommonUserName)
Call ndoc_Memo.AppendItemValue("SendTo", SendTo)
Call ndoc_Memo.AppendItemValue("Subject", m_Subject)
Me.Caption = n_Session.CommonUserName
Set nrtf_ItmBody = ndoc_Memo.CreateRichTextItem("Body")
'Body text
nrtf_ItmBody.AppendText (m_Body)
'This is where you can add support for attachments.
m_attachment = attDir
If m_attachment = "" Then
'No attachment
Else
Call nrtf_ItmBody.EmbedObject(EMBED_ATTACHMENT, "", m_attachment) 'attaches the file to the body field
End If
' Send the document.
ndoc_Memo.Send (False)
MsgBox "Mail Sent with Attachment " & m_attachment
Exit Sub
ErrorHandler:
If Err.Number = -2147217504 Then
strErr = "Passwords are case sensitive - be sure to use correct upper and lower case."
MsgBox "Notes Error: Wrong Password." & vbCrLf & strErr, 16, "Err No. " & Err.Number
Else
strErr = Err.Description
MsgBox "Notes Error: " & vbCrLf & strErr, 16, "Err No. " & Err.Number
End If
Err.Clear
End Sub
Hope this Helps
|
|
|
|
|
Dim rsMail As ADODB.Recordset
Dim rsDbr As ADODB.Recordset
Dim rsDATE As ADODB.Recordset
Dim OutApp As Outlook.Application
Dim OutMsg As Outlook.MailItem
Dim OutRecip As Outlook.Recipient
Dim OutAttach As Outlook.ATTACHMENT
'References:
Microsoft Outlook Object 8.0 Library
Microsoft ActiveX Data Object 2.x Libray
Public Sub sbrSendMail(ByVal mTemplate As Boolean)
On Error GoTo MailErr
Screen.MousePointer = 13
'Create the Outlook sessionand logon
Set OutApp = CreateObject("Outlook.Application")
Set OutMsg = OutApp.CreateItem(olMailItem)
With OutMsg
'Open sql file for email addrs
Set rsMail = New ADODB.Recordset
sQry = "Select email from arcserve_mail where runapp ='dbr' or runapp ='yn'"
rsMail.Open sQry, gcnAdo
Do While rsMail.EOF <> True
' Add the To recipient(s) to the message.
Set OutRecip = .Recipients.Add(rsMail!email)
OutRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = mlSub
.Body = fldH & vbCrLf & dfCust & vbCrLf & vbCrLf & vbCrLf _
& vbCrLf & "Report DATE: " & Now
.Importance = olImportanceHigh
If rsMail.EOF = True Then Exit Do
rsMail.MoveNext
Loop
'Resolve each Recipient's name.
For Each OutRecip In .Recipients
OutRecip.Resolve
Next
' Should we display the message before sending?
If mTemplate Then
.Display
Else
.Save
.Send
End If
End With
rsMail.Close
DestroyRefs True
Screen.MousePointer = 0
'Notify the user
alMsg = "Mail sent succesfully!"
Exit Sub
MailErr:
MsgBox "Error: " & Err.Description, 16, "Mail Err"
Err.Clear
End Sub
Public Sub DestroyRefs(Ref As Boolean)
'Release all references
Set rsDbr = Nothing
Set rsMail = Nothing
Set OutApp = Nothing
Set OutAttach = Nothing
Set OutMsg = Nothing
Set OutRecip = Nothing
End Sub
When using Microsoft Outlook the code shown above will work perfectly. Just make sure to add the two references.
|
|
|
|
|
Is there any way to generate macros for web page icluding link,textbox,button etc.
abc
|
|
|
|
|
How to record web page link, button etc with .net. It is possible to automatic generate record code on any click on web page
abc
|
|
|
|
|
What is it you want to do ? Record your actions on a web site ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|