|
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
|
|
|
|
|
I want to record action of web page like requesting of url, input in textbox, click on button. Record action should generate .net code. So next time I only run record action which save my time to do navigation from scratch
abc
|
|
|
|
|
If saving time is what your're after then forget recording actions and look at caching[^].
|
|
|
|
|
I already answered this. There is NOTHING that will watch you surf the web and generate VB.NET code to duplicate what you did.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How to Decrypt string which has been encrypted using SHA256
Thanks
|
|
|
|
|
It's a hash, so you can't. The hash doesn't contain all the data found in the original string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
you can break the hash using bruteforce or tables method.
if you want to bruteforce the hash, you better have a real good processor and lots of patience, because it's going to take too long(months/years)...
tables are lot faster but i dont know anyone that have sha256 tables (maybe NSA ^^)
anarchy will bring us order
|
|
|
|
|
Sir,
In C++ exe we knows that there is a main() .So Window knows where to execute the code in the c++ output exe, I mean there is a starting point , that is the execution will take place from the main().Now my queston is , In the Vb.Net What is the starting point.I mean From which point the exe will execute the code.
Thanks.
|
|
|
|
|
static void Main
The trouble is, VB.NET hides this from you by default, I believe, and just generates the code behind the scenes to run your main form. But, you can make this method visible, so you can change it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sir,
Thank you very much for ur kind attention.
I want to ask one more thing.How can i make that static void main function visible.
Thanks
|
|
|
|
|
Sorry, if I knew, I'd have told you. Just adding it explicitly may do the trick.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I hav developed a application which has to access the database from a centralized location(Server).
The Connection String i was using before to access the DB from the same(local) computer was...
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\xx\xx.mdb;Jet OLEDB:System Database=system.mdw;"
The Connection String i am using now to access the DB from the server is...
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath("\Leave\Leave.mdb") & ";"
But an error is raising...as
ERROR - - - - - -> Name Server is not declared.
I had used namespaces ->
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
Is there any other namespace tobe provided.
(Or)
Is it any other problem.
Plz help...
Jats
|
|
|
|
|
Jats_4ru wrote: ERROR - - - - - -> Name Server is not declared.
Herer[^] is the info you need.
The method is in System.Web, and if you don't have that, you probably are not within a web app. The client can't use this to map to the server, how does it know where the server is ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Thankx Christian.
Actually i am a bit new to .NET
Can you plz guide me how to Convert the present application developed in VB.NET to Web app.
-- modified at 0:48 Thursday 19th October, 2006
Jats
|
|
|
|
|
Hi,
Well, I'm currently taking an introduction to visual basic class, just to let you know what kind of person I'm am if that's any help.
Anyway, I'm trying to study for the SAT's and focus on my regular class work as well. One of my teachers suggested going to this site:
http://www.collegeboard.com/apps/qotd/question
Basically, CollegeBoard posts a new SAT question of the day each day.
Since I normally don't have time to go on the computer every sing day, I was thinking of devoloping an application that would go to that link, copy and past the question and answer, and storing it into a SQL server database all with one click or something. I don't really know where to start, and I don't really know how to do it. (I only know the really raw basics). Sorry if I posted this in the wrong section or something, maybe this program can better be written in another language? I don't know any other language besides a few of visual basic, sql, and asp.net. And I code in Visual Studio 2005.
Sorry if I sound stupid...
Thanks,
Justin
|
|
|
|
|
I had a look at that site & I don't think it's possible as they don't offer any RSS feeds or other web services.
Why don't you subscribe to their email service instead? It'll be way easier.
|
|
|
|
|
I was trying to link my vb6 to the MYSQL but i got this
Error:"user defined type not defined"??
<big>Dim dbb As Database</big> <-- Error<br />
Dim rs As Recordset<br />
Dim strConnect As String<br />
Dim strSQL As String<br />
Dim strResult As String<br />
<br />
'Set connect string.<br />
strConnect = "ODBC;DSN=DSN_SP_TEST;"<br />
<br />
'Open the database<br />
Set dbb = DBEngine.Workspaces(0).OpenDatabase("", False, False, _<br />
strConnect) <br />
'Create the stored procedure. It really does not do much.<br />
'It simply sets the variables and returns<br />
strSQL = "/****** Object: Stored Procedure dbo.sp_Vendor */"<br />
strSQL = strSQL & vbCrLf & "CREATE PROCEDURE storebo.sp_vendor"<br />
strSQL = strSQL & vbCrLf & "/* Declare Parameters */"<br />
<br />
strSQL = strSQL & vbCrLf & "@param1 varchar(20) ,@param2 varchar(20) ,"<br />
strSQL = strSQL & vbCrLf & "@param3 smalldatetime ,@param4 smalldatetime"<br />
strSQL = strSQL & vbCrLf & "as"<br />
strSQL = strSQL & vbCrLf & "begin"<br />
strSQL = strSQL & vbCrLf & "SELECT dep.[name],dep.deptcode,dep.deptdesc,dep.depttotal, (dep.DeptTotal / (SELECT sum(dep.depttotal)"<br />
strSQL = strSQL & vbCrLf & "FROM (SELECT v.[name],d.deptcode,d.deptdesc, SUM(ti.totalsales) AS DeptTotal"<br />
strSQL = strSQL & vbCrLf & "FROM item i ,vendor v,tot_item ti INNER JOIN dept d ON (ti.deptcode=d.deptcode) where ti.itemcode=i.itemcode and v.vendorid=i.vendorid and v.[name]>=@param1 and v.[name]<=@param2 and ti.bizdate>=@param3 and ti.bizdate<=@param4"<br />
strSQL = strSQL & vbCrLf & "group by v.[name],d.deptcode,d.deptdesc) AS dep )) * 100 AS PercentOfSales"<br />
strSQL = strSQL & vbCrLf & "FROM (SELECT v.[name],d.deptcode,d.deptdesc, SUM(ti.totalsales) AS DeptTotal"<br />
strSQL = strSQL & vbCrLf & "FROM item i ,vendor v,tot_item ti INNER JOIN dept d ON (ti.deptcode=d.deptcode) where ti.itemcode=i.itemcode and v.vendorid=i.vendorid and v.[name]>=@param1 and v.[name]<=@param2 and ti.bizdate>=@param3 and ti.bizdate<=@param4"<br />
strSQL = strSQL & vbCrLf & "group by v.[name],d.deptcode,d.deptdesc) AS dep"<br />
strSQL = strSQL & vbCrLf & "ORDER BY dep.[name] ASC"<br />
End<br />
MsgBox strSQL<br />
db.Execute strSQL, dbSQLPassThrough<br />
-- modified at 22:16 Tuesday 17th October, 2006
|
|
|
|
|
I don't see a UDT in the code you have posted ? It looks to me like you almost got to the part that matters and stopped.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
User Defined Type.
A custom type that you create, specifying it's structure, members, and member types.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
what should i need to create for database?
|
|
|
|
|
The compiler is bitching because the type "Database" doesn't exist, or at least you haven't supplied enough information to tell the compiler where to find the Database type definition. Is this an ADODB Database object? If so, you'll probably have to do something like this:
Dim dbb As ADODB.Database
DO NOT COPY AND PASTE THIS CODE INTO YOUR APP!! I have no idea if it's going to work and can't even tell you if the Database object you're looking for is even in the ADODB namespace.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|