Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could download and burn a Linux LiveCD, boot from it, then copy the folder/files to a FAT32 partition. Then delete the original files and copy the copied folder/files back to their original locaion. That should kill the original ACLs (access control lists).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Of course it only works on individual words. What did you expect?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Lime chili peanuts.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If one of the ways people can target expertise is via endorsements then that will have to be revisited (is there anyone here who didn't expect me to bring this up yet again). When a member's endorsements were obviously achieved by self-endorsement then those endorsements should be removed. It's one thing when the advice is free, another entirely when it is paid-for. The OP has the right to expect that endorsements (a measure of a member's standing in the community) was legitimately earned.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

@Stuugie - I know of one application at Dovercourt when I retired in 2008. It was running, believe it or not, in a Windows 98 virtual machine.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If a thread goes dead without being marked as solved then after a suitable period the bounty could go into general revenue. Another thing to consider is hijacking. We have all seen a thread get answered (and possibly marked as solved) only to have a new poster ask another question. Sometimes the poster will ask follow-up questions. How do you manage asking for a bounty on that?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can also see from the *.Designer.vb file that there are other properties that you may want to set. You will also have to add event handlers at runtime. You can see how to do that here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I find the easiest way to figure this out is to place the controls in the IDE then look at the <form>.Designer.vb file that is created when you save. If you do that the sequence becomes (with a little rearranging for personal taste)

  1. Create the tab control and add it to the form
  2. Create the tab pages and add them to the tab control
  3. Create controls for the individual tab pages and add them to that page

Here is some sample code to use on a blank form

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

    'Create the tab control and add it to the main form

    Dim tbc As New System.Windows.Forms.TabControl()
    tbc.Location = New Point(10, 50)
    tbc.Name = "tbcMyTab"
    Me.Controls.Add(tbc)

    'Create three tab pages and add them to the tab control

    For i As Integer = 0 To 2
        Dim tbp As New System.Windows.Forms.TabPage()
        tbp.Text = "Page " & i
        tbc.Controls.Add(tbp)
    Next

    'Create a text control and add it to the last tab page

    Dim txt As New TextBox
    txt.Text = "default text"
    tbc.TabPages(2).Controls.Add(txt)

End Sub

Keep in mind that unless you declare tbc at the class level you will have to refer to the control in other subs/functions as

Dim tbc As TabControl = Me.Controls("tbcMyTab")
tbc.TabPages ... etc

The same thing applies to any other controls you add to the tab pages.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I agree with pritaeas. In order to help avoid gaming the OP should pick which answers, if any, were helpful. I have occasionally posted in a thread, not with a solution, but with a reply stating why a particular proposed solution was incorrect. While this does not strictly speaking help the OP directly, it could save him/her some wasted time. I wouldn't feel comfortable being automatically given a portion of the bounty under those circumstances.

However, because I am not in this for the money, I would be quite happy just donating any loot back to daniweb.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Weird. Perhaps it is something specific to Access. If I ever install it again I'll have to try it out to see for sure.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

When I try to create I get

Error:: CreateDatabase ( Inventory): Class not registered

I don't have Access installed. I thought it might be somethinig I could figure out without having to install anything. I don't need Access (although I do have Office 2003) because I have MS SQL installed. Can you show me anywhere that says OleDB supports named parameters? Even Microsoft says it does not.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There must be something very different between your system and mine because when I run your code I still just get

Must declare the scalar variable "@parm".

I'm running vb.net (Visual Studio) 2010. According to MSDN, "OleDb doesn't support named parameters."

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think they tried that more than 10 years ago. As I recall the intention was to split them between OS and apps. It didn't stick. Too many friends in the justice department or in the House I guess.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you start wiith a class level variable to contain the running total, and another to contain the number of scores then you can have a textbox for entering the scores one at a time. Add a button which the user can click after a new score is entered. The button code will increment the number of scores entered and add the new score into the running total. It can also add the new score into a display list and present the running average.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think we should all agree that Microsoft terminology sucks. They released Windows 7 followed by numerous Windows updates. After that came Windows 8.0. No problem there. Then they released Windows 8.1. Still no problem. Windows 8.1 was the new base point. Updates were released under "Windows update". All well and good. But then they went off the rails. Microsoft decided to release a new base point, but instead of calling it Windows 8.2 they called it "Windows Update" with a capital U. And to cap it all off they say that in order to continue to receive Windows updates you must install Windows Update. Let me repeat, in order to be able to install Windows 8.1 updates you must install the Windows 8.1 Update update. No chance for confusion there, right?

Morons.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We have an elderly friend who takes medication for a heart problem. Unfortunately, she believes all the nonsense spouted by the modern snake oil peddlars so whenever something new comes along (the most recent was the blue-algae pills) she stops taking her meds and starts taking the new stuff. Every time this happens she eventually ends up in the hospital where she gets put back on her meds until she is stable. This has been the case for magnet therapy, honey, birch water, oxygenated water and who knows what else. Hospitalized every time. All these bullshit treatments come at a ridiculous price.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We can't say whether or not you are doing it right if you don't show us what you have so far. You say you want to find the average of an arbitrary number of scores. Are the numbers to be entered all at once or one at a time?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That tells me that _Req is of type HttpWebRequest. That does not tell me the type of WebRequest. I am assuming the error is caused by accessing WebRequest from a background thread. I am also assuming WebRequest is an instance of a control (I didn't see a declaration so I don't know) If that is the case then the following might work (and it might not). If WebRequest does not support InvokeRequired then this will not work.

Main Thread

Private Delegate Function dlgMakeWebRequest(req As String) As HttpWebRequest

Private Function MakeWebRequest(req As String)

    If WebRequest.InvokeRequired Then
        Dim dlg As New dlgMakeWebRequest(AddressOf MakeWebRequest)
        Return Me.Invoke(dlg, req)
    Else
        Return WebRequest.Create(req)
    End If

End Sub

Background thread

Public Function _ValiAcc(ByVal url As String, ByVal usrname As String, ByVal passwrd As String, ByRef result As String)
    _Req = MakeWebRequest(url & "login.php?u=" & usrname & "&p=" & MD5_encode(passwrd))
    _Resp = _Req.GetResponse
    _GStream = _Resp.GetResponseStream
    _ReadS = New StreamReader(_GStream)
    result = _ReadS.ReadToEnd()
    Return result
End Function
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sounds like you want someone to do your homework for you. That's just not going to happen.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You sent me Dragon.rar which does not contain the code that declares WebRequest. Unless I know what WebRequest is I can't say whether or not I have a solution.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

T-shirt weather yesterday and today, and the snow is almost all gone. And only a month late.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

For the record, I do not believe doctors should write prescriptions for sugar pills. Pharmacists are paid a dispensing fee for their expertise. I do not think they should be paid anything for selling sugar pills. However, if the doctor wants to try a placebo he should keep a stock on hand and supply them directly. Doctors often do that with samples anyway.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Also in placebo-surgeries if you tell the person a few months later that it was a sham the benefits don't go away.

Do you mean like the "psychic" surgeons who pretend to remove some fake entrails? Then the patient goes away cured only to die of cancer?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If some-one gets relief from their chronic pain by taking sugar pills is it right to stop them from taking them?

If the pain is being caused by some underlying condition that is getting worse because it is getting masked instead of treated then, yes, it is right to stop them and get proper diagnosis and treatment. And I would have the same advice to someone who was taking legitimate painkillers instead of seeking treatment. I had a friend who died of colon cancer because he thought he just had digestive problems.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is WebRequest declared in the main thread?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I already showed you how to do that by using a timer that is activated by the button so you can effectively put a timer in a button click. One further option I could suggest is the following which is a really bad idea. I'll show you the code then tell you why it is bad.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
    While powervalue >= 10 
        powerDecrease() 
        TextBox3.Text = CType(Me.powervalue, String) & "V" 
        System.Threading.Thread.Sleep(1000)
    End While 
End Sub

This (effectiively) does the same thing as the timer solution. It pauses for one second after each recalculation. The reason this is a very (VERY) bad idea is because it causes your entire application to become unresponsive (the entire app goes to sleep for one second each time through the loop). Using a timer avoids this.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Then I don't see the problem. When you calculate the new value just copy it to the textbox or label to display it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Agreed - the creams have a few other ingredients to irritate the skin to cause swelling to hide the wrinkles. The point is that these "magical" ingredients that add fractions of a cent to a jar of cream can boost the price by tens of dollars. It is quackery, plain and simple.

If you watch Burn Notice you will have heard the axiom that when it comes to information, the more it costs you to get it the more highly it is regarded. The same holds true for cosmetics, and fashion, and apparently medicine regardless of the actual intrinsic value. A pill that costs $100 a pop must be much more effective than one that costs 20 cents. A few years ago a drug company discovered that a pill that was used for cattle (10 cents a pill) was effective for treating certain forms of cancer. The same pill was then sold (for human use) for $20 a pill. (I could try to find the actual incident but for now I am relying on memory).

Another site to check out is Quackwatch

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It is showing you all of the results. It's just that all of the intermediate results are appearing so fast you don't get a chance to see them. I'm assuming powervalue is declared at the class level. In that case you could set up a timer with an interval of 10000 (10 seconds) and do the following

Private Sub tmrMyTimer_Tick(sender As Object, e As EventArgs) Handles tmrMyTimer.Tick

    If powervalue >= 10 Then
        PowerDecrease()
        TextBox3.Text = CType(Me.powervalue, String) & "V" 
    Else
        tmrMyTimer.Stop
    End If

End Sub     

Then in the button code you could do

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 

    powervalue = <some initial value>
    tmrMyTimer.Start

End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Let's try to keep things civil.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sometimes there are functions you want your program to perform in the background while you are busy doing other things. For example, if you are building a picture viewer application you may not want to wait until thumbnails are generated before getting on with the business of viewing the pictures. If you have ever used the FastStone Image Viewer you will have noticed the progress bar at the bottom of the screen when browsing to a new folder. That bar shows the progress of a background thread which is busy scanning the current folder. If you try to change the sort order of files during the scan you will get the message Background thread is busy scanning the current folder. Try again later.

Implementing background threads can be easily done (but with a couple of gotchas). I hope this tutorial will be enough to get you started.

Development Environment: vb.net 2010
Development Platform: Windows 7 Pro (32 bit)

The following form will be used in the tutorial:

The objects are as follows:

frmBGTest   the main form

    .Text = "BG Test"

btnStart    Button

    .Text = "Start"
    .Enabled = True

btnStop     Button

    .Text = "Stop"
    .Enabled = False

Label1      Label

    .Text = "Foreground"

Label2      Label

    .Text = "Background"

lblFGStat   Label

lblBGStat   Label

bgwThread   BackgroundWorker

prgThread   ProgressBar

    .Dock = Bottom

This example will run a background thread for 30 seconds. Progress of the thread will be shown by three different indicators. A progress …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I love James Randi (born and raised in Canada). One of my favourite quotes is from him, to wit, "No amount of belief establishes a fact."

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Ah.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Why is it you never see the headline "Psychic Wins Lottery"?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Of course, you are correct. I meant the new age crystal whack jobs and used the wrong term. Apologies.

I am disgusted. As I am typing I have the news on and they are reporting about a psychics/mediums fair that is in town this weekend. They reported the event without adding that there is no scientific evidence to support the claims of either psychics or mediums.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In the user profile under contributions there are line items for Discussion Threads and Code Snippets. How about adding an item for Tutorials?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

it is unreasonable to expect people to research the evidence supporting every claim of every product they use

Let's take all those "miraculous" anti-aging face creams. Anyone with eyes, ears and a TV set (unless they are watching nothing but reality crap and game shows), or an internet connection should be aware that all face creams are basically just a moisturizer and a scent. Even the fancy, $100 an ounce, used by Beyonce creams are just a few cents worth of moisturizer plus a nice smell. Anyone who has been taught critical thinking and analysis can plainly see the difference in lighting between the before (light from above or below to exaggerate wrinkles) and after (direct light to hide wrinkles) shots. Ever notice in the TV makeover shows, the woman is always scowling in the before shot and beaming in the after shot?

And why is it that these creams are always endorsed by some 30-something super model but sold to 50-something women?

It's one thing for a product to claim "eases cold and flu symptoms". You can drop $5 on it and see for yourself. But when a product makes extraordinary claims it requires extraordinary proof.

A while back, a researcher published a famous study linking vaccines with autism. This was an extraordinary claim which should have been subject to peer-review, verification and replication. It was not (at least not for a while). During that time untold numbers of parents withheld vaccines from their children with the …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Let's be clear - a warning label on a bag of peanuts stating "may contain nuts" is one thing (it's redundant and stupid); a warning label stating a product was made with peanut oil is something else entirely. I'm not saying all warning labels are stupid and should be removed. Just the ones that would be obvious to anyone with more than three brain cells.

Getting back on the topic of homeopathy, if people were given even the most rudimentary education in science they would be able to see that homeopathy is nothing but nonsense. Unfortunately, much of what passes for science education consists of rote memorization. What must first be taught is the scientific method and skills in analysis and critical thinking. Students must be taught to be skeptical and to question rather than to blindly accept without reasonable proof. Is it reasonable to assume that water can be imprinted with the memory of the substance it contained? Then what is this mechanism and if shaking the water is the method then why isn't all the water we flush down the toilet imprinted with the memory of what it is flushing?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That depends. Is it very large? I'm not really keen on wading through several thousand lines of possibly undocumented code. And is it something I can run on my computer without setting up a special environment? I would also have to be vb.net 2010. How about just posting the code for the eFunctions class to start?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try just

sqlCmd.Parameters.AddWithValue("@teamMemberEmpID", teamMemberEmpID)
sqlCmd.Parameters.AddWithValue("@start", start)
sqlCmd.Parameters.AddWithValue("@finish", finish)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I posted a reply but it disappeared. Is it possible either eFunctions._ValiAcc is being called from two different threads at the same time, or that the code in eFunctions._ValiAcc is trying to modify a foreground control? The second scenario is usually what causes the error you are seeing.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Homeopathy is akin to astrology, but more dangerous.

When you consider Presiden Reagan consulted an astrologist in order to help make important decisions I have to wonder.

helping us to weed the garden

Lately I've been in favour of removing almost all warning labels from things. I think that warning labels advising against standing on the very top step of a ladder are completely unnecessary. Likewise with warnings advising "wearing this Superman suit does not enable the user to fly", or labels on hammers stating "not for internal use". I think the sooner we can weed out the people whom these labels are protecting the better (preferably before they reproduce). I refer you to the first 15 minutes of Idiocracy.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm thinking you are using Parameterized Queries with OleDB. I have noticed that when I try

cmd.CommandText = "SELECT au_lname,au_fname,zip FROM authors WHERE au_lname LIKE ?"
cmd.Parameters.AddWithValue("@parm", "D%")

my code works but when I try

cmd.CommandText = "SELECT au_lname,au_fname,zip FROM authors WHERE au_lname LIKE @parm"
cmd.Parameters.AddWithValue("@parm", "D%")

I get Must declare the scalar variable "@parm". There is another thread in this forum where someone claims that the second format actually works. I am awaiting clarification but for now if you use the first form you shouls be able to eliminate the error. Keep ini minid that you must use AddWithValue in the same order in which the parameters appear ini the query.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

All I know is that when I try

cmd.CommandText = "SELECT au_lname,au_fname,zip FROM authors WHERE au_lname LIKE ?"
cmd.Parameters.AddWithValue("@parm", "D%")

my code works but when I try

cmd.CommandText = "SELECT au_lname,au_fname,zip FROM authors WHERE au_lname LIKE @parm"
cmd.Parameters.AddWithValue("@parm", "D%")

I get Must declare the scalar variable "@parm". If there is something I'm doing wrong I'd like to know what it is so I can correct it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Private Sub loginWorker_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles loginworker.DoWork
        Try
            MySub(My.Settings.adress, tbuser.Text, tbuser.Text & tbpwd.Password, eResult)
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Error!")
        End Try
    End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Private Delegate Sub dlgMySub(addr as String, user as string, pass as string, eResult as String)

Private Sub MySub(addr as String, user as string, pass as string, eResult as String)

    If efunctions.InvokeRequired Then
        Dim dlg As New dlgMySub(AddressOf MySub)
        Me.Invoke(dlg, addr, user, pass, eResult)
    Else
        eFunctions._ValiAcc(addr, user, pass, eResult)
    End If

End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Let's say you want to modify the value of a label from a background thread. You can't do that directly so you create a delegate. At the class level in the maini form you do something like

Private Delegate Sub dlgUpdateStatus(text As String)

and in the main thread you have the sub

Private Sub UpdateStatus(text As String)

    'The InvokeRequired method returns True if the thread that calls
    'it is running from a different thread. In that case we create a
    'delegate to do the update of the control's text otherwise we can
    'update the text directly.                                                         
    If lblStatus.InvokeRequired Then
        Dim dlg As New dlgUpdateStatus(AddressOf UpdateStatus)
        Me.Invoke(dlg, text)
    Else
        lblStatus.Text = text
    End If

End Sub

You can call this sub from the main thread or any other thread and it will do the update properly.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You have to use a delegate. There is an example here

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Further on the Cochrane Collaboration, their reviews generally contain a PEARLS section (Practical Evidence About Real Life Situations) which gives a short summary, often including something like

Caveat

Selective reporting of outcomes, adverse events and inclusion of people with cardiovascular disease in many of the trials included in previous reviews of the role of statins in primary prevention make the evidence impossible to disentangle without individual patient data. Caution also needs to be taken regarding the fact that all but 1 of the trials had some form of pharmaceutical industry sponsorship. Overall, the populations sampled within this review were white, male and middle-aged. Therefore, caution needs to be taken regarding generalisability to older people who may be at greater risk of side effects, and to women who are at lower risk of CVD events.

They do not do any primiary studies of their own. What they actually do is review all available studies ini different areas and try to determine what legitimate conclusions (if any) can be drawn. As you can see above, they will point out where studies are possibly flawed or biased (either intentionally or unintentionally).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As long as we are on the topic of pseudo-science, I want to mention the term "Gish Gallop". It was named after Duane Gish who was an American biochemist, a former vice-president of the Institute for Creation Research and the author of numerous publications about creation science. The Gish Gallop consists of spewing so much bullshit at your opponents that they spend all of their time trying to refute your claims and have no time left over to make their own case. Generally, in the shuffle, no one is supposed to notice that you have provided no evidence to substantiate your claims. This technique is highly effective in politics as well.