|
Just implement Windows Media Player into your app.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hi
How can we capture the incoming net send message in vb.net?
Thanks
vijay
v
|
|
|
|
|
You can't really intercept them without writing your own packet sniffer ad reassembling the traffic yourself.
The other way to do it is to stop the Messenger service that comes with Windows and write your own replacement for it, taking over the TCP/IP port that it normally listens to.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I have an application that closes all IE windows that have "MKR" string in the address when the application closes. The problem is that explorer.exe is still listed in the processes. How do I get rid of the process when I close the application?
SR
|
|
|
|
|
You do know that explorer.exe is the process that give you your desktop, right? Why would you want to stop that?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
The EXE you should look for is iexplore.exe.
Shreekar
|
|
|
|
|
Hi,
I am trying to execute the the function "RegSetKeySecurity" from advapi32.dll in VB Script.
for creating the object i am using wshAPIToolkitObject but i am getting the error...
"WScript.CreateObject: Could not locate automation class named "wshAPIToolkitObject.ucATO"
code :
Set oATO = WScript.CreateObject("wshAPIToolkitObject.ucATO")
lResult = oATO.CallAPI("advapi32.dll", "RegSetKeySecurity", hKey, SecurityInformation, pSecurityDescriptor )
please help me...do i need to have some dlls ?
or i need to register some dlls ?
|
|
|
|
|
It would appear that you either don't have this library installed (it's not part of Windows) or you do have it and it's not registered properly (use REGSVR32).
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
can anyone tell me how to connect to an access database and then add a feild to that database.
any help with this would be greatly appreciated as i literally don't have a clue how to do it.
|
|
|
|
|
what are you using ? adodb ? adodc ?
adding field/column ? why dont you make it directly in access ? or did you mean insert value of your table's fields ?
you can use sql - INSERT command to insert value of fields
and ALTER for add and drop column...
if you're using adodb.. here is the connect function
<br />
Function connect() As Boolean<br />
Dim strConnect As String<br />
connect = False<br />
On Error GoTo errHandler<br />
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\dbpakar.mdb;"<br />
Set conn = New ADODB.Connection<br />
With conn<br />
.CursorLocation = adUseClient<br />
.Open strConnect<br />
End With<br />
connect = True<br />
Exit Function<br />
errHandler: Debug.Print "ERROR! error number: " & Err.Number & ", Description: " & Err.Description<br />
End Function<br />
dont forget to declare the conn , e.g
<br />
Public connVP As ADODB.Connection<br />
if you're using adodc, then just set the adodc's property.
sorry if this isn't the answer that you're looking for- i misunderstood it then..
Practicing
|
|
|
|
|
im using oledb. this is how i've tried to do it. it doesn't come up with any problems but it doesn't work.
Imports System.Data.OleDb
Public Class Cust
Inherits System.Windows.Forms.Form
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim icount As Integer
Dim str As String
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=PCBank.mdb;")
cn.Open()
str = "insert into customer (CustomerID, CustomerSurname, CustomerForename) values ('tbID', 'tbSur', 'tbFor')"
'string stores the command and CInt is used to convert number to string
cmd = New OleDbCommand(str, cn)
icount = cmd.ExecuteNonQuery
MessageBox.Show(icount)
'displays number of records inserted
Catch
End Try
cn.Close()
End Sub
End Class
|
|
|
|
|
sorry, did you succesfully connect to your db ?
i mean, where is your problem ? adding or connect ?
then what was the error message ?
Practicing
|
|
|
|
|
i dont know whether i have connected to the database or not, how can i tell?
i think i may of, there are no error messages . but when i add new record, no record gets added. i think that adding the record may be the problem?
|
|
|
|
|
Learn about the Try/Catch Statement.
This is how you would use it..
Try<br />
<br />
[bla bla bla]<br />
<br />
Catch ex As Exception<br />
Me.lbl.Text = ex.message<br />
End Try
The label called "lbl" should then display the error for you. Sorry this is vb.net code. I hope it's ok.
|
|
|
|
|
To check state of connection, you can use cn.ConnectionState or something like it.
The problem is you are eating up the error by not doing anything in the Catch block.
Do something like the other poster suggested to see if you have any error.
Also, your problem is this:
peteyshrew wrote: values ('tbID', 'tbSur', 'tbFor')"
You cannot insert a string for CustomerID (I am assuming).
What you need (maybe) is
CInt(tbID.text), tbSur.Text, tbFor.Text
A better method is to use stored procs to do this to avoid SQL injection attacks.
Hope this helps.
Shreekar
|
|
|
|
|
Imports System.Data.Oledb
Dim con as new Oledb.OledbConnection("Provider=Microsoft.Jet.Oledb.4.0; " & _
"Data Source=dbase.mdb")
NOTE: Put this code under the Public Class Form1
CODE OF BUTTON SAVE:
Dim objDataAdapter As New OleDb.OleDbDataAdapter
Dim objCommand As New OleDb.OleDbCommand
Dim objDataTable As New DataTable
Dim objDataSet As New DataSet
Dim objOleCon As New OleDb.OleDbConnection
Dim strInsert As String
Dim strSelect As String
Try
strSelect = "Select * from Table1"
strInsert = "Insert into Table1 (name,address) Values('" & tname.text & "','" & taddress.text & "')"
objOleCon = New OleDb.OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0; " & _
"Data Source=dbase.mdb")
objDataAdapter.SelectCommand = New OleDb.OleDbCommand(strInsert, objOleCon)
objDataAdapter.Fill(objDataSet)
objDataTable = objDataSet.Tables(0)
With objCommand
.Connection = objOleCon
.Connection.Open()
.CommandText = strInsert
.CommandType = CommandType.Text
.ExecuteNonQuery()
.Connection.Close()
End With
MsgBox("Record Saved")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Don't block the drive way of all the newbies in programming. )
|
|
|
|
|
Open Outlook Express with Attachments from VB.NET
When u attempt to Attach, please don't use the SendKeys.
How can I ?
|
|
|
|
|
Outlook Express doesn't expose an object model you can use. It's done through MAPI API calls.
There is no provision in RFC 2368 specifying any kind of support for adding attachments in a mailto: URI. Support for "attach", or some other keyword, is non-standard and completely up to the manufacturer of the mail package.
AFAICT, Outlook and Outlook Express don't support the attach keyword because of security concerns with viruses and trojans emailing themselves to the entire address book.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
when i click on NEW button i want all form controls such as textbox,radiobutton and checkbox will refresh
what i do for that (compulsary throgh loop)
|
|
|
|
|
Then use the Form.Controls property, see here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
yes it is
but i want coding to use it
|
|
|
|
|
hence code!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hello,
I have user control that has been placed on many tab pages. The tab control is not part of the user control. The user control consists of text boxes and combo boxes
The user can add new tabs and enter the data into it the user control and click save which is also part of the user control. However, if they decide to save on a previous tab and then click save it will save the contents of the text boxes and combo boxes that are on the last tab.
This is because the text boxes and combo boxes are taken from the last ones that are created.
How can I select another tab and click save, and save the contents of those text boxes and combo boxes on that tab?
my code for the save button in the user control.
Code:
<br />
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click <br />
Try <br />
Dim rowsAffected As Integer = Me.TA_IncidentTask1.UpdateTask(_incidentID, Me.cboSupportType.Text, Me.cboUsers.Text, Date.Now.ToLocalTime(), Date.Now, Me.txtTaskDetails.Text, Date.Now, Date.Now.ToLocalTime(), Me.cboStatus.Text, String.Empty, String.Empty, Me.txtCompletionNotes.Text, _taskID) <br />
Catch ex As Exception <br />
MessageBox.Show(ex.Message) <br />
End Try <br />
End Sub<br />
Many thanks for your help,
Steve
|
|
|
|
|
Hello,
I am using this code to loop through a tab control and get the name of the tab.
However it always fails with an index error on the last tab, even though it does get the name of the tab on the last one.
Can anyone see if there is anything wrong with the code below.
Code:
Dim i As Integer = 0
For i = 0 To Me.TabControl1.TabCount
taskID = Me.TabControl1.TabPages(i).Name
Next i
Many thanks,
Steve
|
|
|
|
|
Hi there,
Do the following:
Dim i As Integer = 0
For i = 0 To Me.TabControl1.TabCount - 1
taskID = Me.TabControl1.TabPages(i).Name
Next i
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|