|
You'll have to track the values seperately from the control's actual values. When one of the sliders changes, calculate the change from the last saved value and apply the change to the other values and control's actualt values.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i m getting this error (on Execute line) when i m inserting Data in database....
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in tab.exe
Additional information: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
Public strSQL As String
Public objCon As ADODB.Connection
objCon = New ADODB.Connection
Dim Rs As New ADODB.Recordset
objCon.ConnectionString = "MaxBufferSize=2048;FIL=MS Access;DSN=Scan;PageTimeout=5;UID=admin;DBQ=D:\VB.Net\VulnerabilityAssessment.mdb;DriverId=25"
objCon.Open()
strSQL = "Insert Into RemoteHost(HostIP, HostAddress,ScanTime)"
strSQL = strSQL & " Values(strIpAddress,Host.HostName ,Date.Now);"
objCon.Execute(strSQL)
objCon.Close()
objCon = Nothing
|
|
|
|
|
You didn't evaluate any of your variables at all. You should have done this:
strSQL = "Insert Into RemoteHost(HostIP, HostAddress,ScanTime)"
strSQL = strSQL & " Values('" & stdIpAddress.ToString() & "', '" & Host.HostName & "', #" & Date.Now().ToString() & "#);"
objCon.Execute(strSQL)
Even then, concatentating SQL statements together like this is a major security risk and can get your SQL tables wiped out.
I would suggest using parameterized queries as explained in Colin Angus Mackay's article, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow - I told him this yesterday
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi
i want to write an application for the desktop sharing, any body can help me or any link or article will be appreciated
ddd
|
|
|
|
|
Google for "VNC" and you'll find tons of stuff.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I make a small project in Vb.NET, it also have some crystal reports. The reports works well in my computer. But when I run my project on other computer, the reports cannot runs well. Actually it gives a dialog box and ask to Enter "Server name","Database Name", "Login ID", "PAssword"
Why this happens when my project runs on other computer.
Plz give me a possible solution.
EsHbAn BaHaDuR
|
|
|
|
|
Use ODBC in Crystal reports for getting data and build ODBC on the Client side after installing the application. Will solve every thing
|
|
|
|
|
Gosh, I wasted alot of time playing around with this.
An ODBC direct link is fine, as long as your data source doesnt change. eg: your software goes out to a customer, with different servername, database name, login, etc.
You can program vb to change the the datasource information at runtime before the report loads. Thats gives you better customisation.
Or alternately, as I have come to realise, do all your data selection in vb, and pass a dataset to CR instead. When designing the report, run your program quickly, but include a dataset.writeschema (c:\myschema.xsd)
Then when you set the datasource for the report, choose xml.
So much easier, neater programming, better maintainability. The selection criteria in CR becomes redundant (which is a blessing).
Or...
yeh, if its just 1 report in your office, odbc links are fine!
|
|
|
|
|
In my VB program Irunning on WIndows 2000 have a WindowsMediaPlayer1 object and an Image1 control and a Scan button that executes the following command:-
Private Sub Scan_Click()<br />
<br />
Image1.Picture = Clipboard.GetData(vbCFBitmap)<br />
<br />
End Sub
So basically what I want to do is press the Print Scrn button and then press the scan push button on my form to copy the Clipboard onto the Image control.
Now the problem is all I want the clipboard to contain is the image at that instance on the Media Player.
Currently I get the whole desktop.
Are they anyway I can limit the clipboard to just capture the WMP image. Someone said use Device Context (DC), but never used them before so would like some notes in the code.
Many thanks,
|
|
|
|
|
Pressing PrintScrn captures the entire Desktop window. Pressing Alt-PrintScrn captures the current window, which in your case, would be the entire MediaPlayer, content and all.
You'd be better off using the MediaPlayer or MultiMedia API's to grab a single frame.
Check out this[^] article on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the post, will look at the article, pity its in C#.
Sweep
|
|
|
|
|
But easily convertible to VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a VB.net project in which I attach to a MSAccess 2000 database. I have a listbox in which I want to populate the most recent records from a table. I have therefore put the following code into the GotFocus event of the listbox
Dim strConString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "User ID=Admin;" _
& "Data Source=C:\MCS\GolfSociety\GolfSociety.mdb"
Dim ocm As New OleDb.OleDbCommand
Dim odr As OleDb.OleDbDataReader
Dim i As Integer
' ocm = New OleDbCommand
With ocm
.Connection = New OleDbConnection(strConString)
.Connection.Open()
.CommandText = "SELECT tblmembers.memID, tblmembers.Name, tblmembers.Club_Hcap, tblmembers.Soc_Hcap FROM tblmembers ORDER BY tblmembers.Name "
odr = .ExecuteReader()
End With
cmbMembers.Items.Clear()
i = 0
While odr.Read
cmbMembers.ListItems.Add(odr("MemID"))
cmbMembers.ListItems(i).ListSubItems.Add(odr("Name"))
cmbMembers.ListItems(i).ListSubItems.Add(odr("Club_Hcap"))
cmbMembers.ListItems(i).ListSubItems.Add(odr("Soc_Hcap"))
i = i + 1
End While
odr.Close()
ocm.Connection.Close()
I would have expected that this would have executed the commandtext each time the listbox got the focus and that if I changed the table in the background that the next time I clicked the listbox I would get the updated records. This does not happen. If I click the listbox and then change the table by opening the database and editing a record, the change does not come through the next time I click the listbox.
Thanks in advance
Brian
|
|
|
|
|
Without knowing where you put this code, it's impossible to tell you if what you're expecting will even work. If I were you, I would probably put this code in your ListBox's MouseEnter event. Even better, I would put a call to this code into whatever method is actually updating the database.
[EDIT]
I was that you said you put this in the GotFocus event. The focus won't change to your ListBox control unless you click on it. By that time, it's too late to update the data in it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a form for entering scores. These scores are dependant on members handicaps which may have changed since the last time the member took part. On the score form I have a drop down combobox which displays the member and his handicap. What I want to be able to do is that if the handicap is incorrect in the combobox, click a button which opens a form so I can then update the member details, and then when I drop the combo box again it will have the new details in it. I have done this and even tried editing the table directly in the background but every time I drop down the combobox it displays the original details for the member. If I open the scores form then edit the table, close the scores form and open it again it will pick up the new details. Basically I want the combobox to display the updated details without having to close and reopen the form,
Regards
Brian
|
|
|
|
|
When the form that you use to enter the new details is closed (assuming it's a modal dialog), you'll have to wipe out the data in the combobox and re-populate it, probably using the same code that populated it in the first place.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you look at the original code sent in, it is clearing the list box and repopulating it.
|
|
|
|
|
If it's still in the GotFocus event, it won't update the ComboBox. You have to update the combobox in another event that doesn't depend on focus. I already suggested the MouseEvent event, but it's better it you repopulate all your data dependant controls just after you update the database.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
well im actually not a newbie.. i started learning vb years ago.. but i stopped studyin about it..
anyway.. i need help. im actually creating a program. and i need help.
its just about simple text switch.
for example. you have two frames with 7 option buttons and 7 text fields (prepopulated) each.
how do i reference the textbox to the option button??
since one can only choose one option from 7options on each frame, how can i exchange the strings on the chosen textfields???
and another thing.. how can i store those 2 strings, so that the data inside the chosen text boxes will change once the strings have been exchanged.. without loading the form again??
help.. i really need help...
|
|
|
|
|
calvin0176 wrote:
how do i reference the textbox to the option button??
You don't.
calvin0176 wrote:
how can i exchange the strings on the chosen textfields???
What? What strings?
calvin0176 wrote:
how can i store those 2 strings, so that the data inside the chosen text boxes will change once the strings have been exchanged.. without loading the form again??
This doesn't make any sense. Perhaps if you setup your questions with an explanation of what is in the textboxes first, then explain what you want to happen when you click on one of the option buttons, we can understand what you want to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Does anyone knows how to create a setup package that will install a custom font into the clients windows\fonts directory without prompting him.
Some People succeed because they are Destined to, but most people succeed because they are Determined to
|
|
|
|
|
the default property of font folder is that if you copy any font it automatically installs it. so you just need to add the font in your setup project and give it destination to windows\font folder and it will be installed
|
|
|
|
|
I have the following problem:
I have a project ActiveX Document (vbd) developed in vb and wanted to develop it in NET.
Everywhere I have read that this is not possible.
Somebody could help me?
Thanks
|
|
|
|
|
VB.NET doesn't build ActiveX documents or binaries.
You'll have to keep using VB6 if you want to continue the project. You'll have to scrap it and start from scratch if you want to do something equivilent in VB.NET or C#. Though, the user will have to have the .NET Framework installed on their machines if they want to use your component.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|