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

Are you asking how to traverse folders to look for file names? And how do you determine if a file is wanted or unwanted?

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

It just seems to me that the effort in automating that process far exceeds the effort in trying various combinations of non-random user IDs. Especially since you'd only have to do it once.

As for the clearing your internet history, cookies, index.dat, etc., you may be interested in knowing that in at least one state (Massachusetts) you could get imprisoned for doing just that.

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

It is now working properly for me.

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

Sounds to me, based on this and your other posts, that you are trying to create an app to automatically create Yahoo accounts and then cover your tracks. It also seems to me that the only reason to automate this is because you want to do it repeatedly. Call me cynical but I can't see any legitimate reason to want to do this.

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

For some projects I can see costs ballooning but the long gun registry should have been almost off-the-shelf. Person buys gun, gun and person go into registry accessible by all law enforcement. That's almost boiler plate database. Our control centre, on the other hand, had to control 15 hydro-electric generating stations, 2 thermal and 4 diesel. Add to that converter stations at each end for HVDC plus dozens of distribution stations. Add to that the software for scheduling outages, matching line voltages and frequencies, software for interconnection to other control centres throughout the American mid west. Now add in analysis software for optimizing generation and water flow. That includes massive databases for management of 4-second resolution data on close to 9000 status points and 10000 analog points. And even that only covers about 70% of the system.

That's for 64 million. There's absolutely no way you can fuck up a gun registry database to the tune of 2 billion without a massive amount of corruption.

By the way, on the previous AGC/SCADA system, the project's head engineer was told that the company's IT department would be maintaining the software (but would not be on 24x7 standby). His response was (in perhaps more PC language) "no fucking way". Everyone associated with the system maintenance was brought directly under his control. That allowed him to manage costs and scheduling.

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

It's all political. We built a state of the art, hurricane proof building for our control centre and filled it with state of the art computers and custom software to control our provincial electrical grid (generation, transmission and distribution). It went live in November 1998 and cost 64 million. The federal government created a Canada wide long gun registry. It cost over two billion. There's no way you can convince me that some political hacks and their friends didn't make a shitload of money that they weren't entitled to. It doesn't matter if the software works well, or even at all (Obamacare website, anyone). All that matters is that some people got rich(er) who didn't deserve it and the rest of us all got a little bit poorer.

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

"I don't fear computers. I fear the lack of them."

Isaac Asimov

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

Perhaps a tad too late (maybe not) but I suggest you partition your drive into C (60-80 gig OS and apps) and D (whatever is left) for data and relocate your user folders (My Documents, My Pictures, etc) there. Install your OS and apps, apply all updates, delete all temporary files (if you applied any Windows service packs then do a Freeze). Install the free version of Macrium Reflect and take an image of C. That way you'll have a clean system to go back to without having to reinstall everything again.

A Freeze deletes all the service pack undo files (frees up a lot of space). To do this, copy the following code into FREEZE.CMD

c:
cd \
cls
dir 
TIME /t
DISM /online /Cleanup-Image /SpSuperseded
TIME /t
dir 

The only catch is that you have to run it as Administrator. The two Time commands are so you can see how long it took and the two dir commands are so you can compare the free space before and after. The whole process can take up to 30 minutes or so. Be patient.

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

GMO only slightly extends our ability to genetically modify our food crops

So you consider inserting a fish gene into a tomato as "slightly extending"?

True, but new combination treatments (Drug A + Drug B) require minimal or no safety testing (since each drug has independently passed safety testing). So why would putting a gene from food crop A (which we already eat & know is safe) into food crop B (which we already eat & know is safe) require extensive safety testing?

For one thing, many drugs that can be safely taken in isolation can be deadly when taken together. Even common household cleansers like bleach and ammonia which can be safely used independently produce toxic fumes when combined.

The vast majority of independent labs confirm that GMOs are safe.

Can you provide a source for this claim?

A major paper by Prof Gilles-Eric Seralini and colleagues was published in Food and Chemical Toxicology in September 2012. It found severe liver and kidney damage and hormonal disturbances in rats fed the GM maize and low levels of Roundup that are below those permitted in drinking water in the EU. It was retracted in November 2013 by the editor-in-chief after pressure from pro-GMO scientists. It was republished by Environmental Sciences Europe with extra material addressing criticisms of the original publication. The republished version contains the raw data, something that the GMO industry has refused to do for their in-house studies. The study …

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

So really all it is doing is generating debt.

When I said "profit", what I meant was profit for the corporations. It's merely another way of transferring money from one class (99%) via taxes to another (1%). Who cares if the 99% go into debt? As goes Kansas so will go the country. They'll just cut services to pay for it all.

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

You can't tell puns to kleptomaniacs. They take things, literally.

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

The US will never nuke the middle east. There's no profit in it. Neither will they withdraw (same reason). War, on the other hand, generates tremendous profit to arms manufacturers, suppliers of clothing, food, services, private contractors for security, rebuilding infrastructure, etc. Look at what it did for Haliburton.

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

A not so often used, but sometimes useful form of the Select Case is that it can be used to select between seemingly unrelated conditions. The form

Select Case True
    Case <condition>
    Case <condition>
    Case <condition>
    Case Else
End Select

will execute the first clause where <condition> evaluates to the expression in the Select Case statement. Because the Select Case clause always evaluates to True, the first Case that evaluates to True will be executed. You can see that the Case statements need not be related so that you could end up with clauses like

Select Case True
    Case x = 5
    Case y = 19
    Case IsEven(3*x + 2*y + 5)
    Case LastName = "Smith"
End Select

As you can see by my example, it can be used to produce horrible logic but used properly it can make your code cleaner.

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

Do

StateSQL = "SELECT * FROM petrol_table " &
           " WHERE fueldate >= " & "'" & M12S & "'" & 
           "   AND fueldate <  " & "'" & M12F & "'"
Debug.WriteLine(StateSQL)

and post the output here.

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

Try

StateSQL = "SELECT * FROM petrol_table " &
           " WHERE fueldate >= @sdate    &
           "   AND fueldate <  @edate"
Conn.Open()
sqlCmd = New SqlCommand(StateSQL, Conn)
sqlCmd.Parameters.AddWithValue("@sdate", M12S)
sqlCmd.Parameters.AddWithValue("@edate", M12F)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Here is a walkthrough from Microsoft.

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

A comprehensive comparison of what features come with what edition of Windows 10 can be found here

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

If you have access to another machine I suggest you download Trend Micro Housecall (free) and burn it to a CD/DVD then boot your computer to the disc.

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

Essential to the pursuit of happiness is knowing when you've caught it.

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

Is it only one one particular project or does it also happen on a new project? If just the one then you may have to recreate it from scratch and copy the code in to the new code window. If that doesn't work you may have to uninstall/reinstall Visual Studio.

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

Try this

ListBox1.Items.AddRange({"the", "quick", "brown", "fox", "jumped", "over"})

TextBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
TextBox1.AutoCompleteCustomSource.Clear()

For Each item In ListBox1.Items
    TextBox1.AutoCompleteCustomSource.Add(item)
Next

Just remove the first statement to use the items you already have in your listbox. There are several different AutoCompleteMode(s). Just pick the one that suits you best.

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

You get the selected node through

TreeView1.SelectedNode

You can select a specific node in code by

TreeView1.SelectedNode = TreeView1.Nodes(0).Nodes(4)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is an addin tool available for versions of Visual Studio up to 2012 that will allow you to easily test your regular expressions. You can find it here

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

I've seen the same thing. Sometimes I have to close the chat twice before it stays closed.

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

For simplicity, when I say "Monsanto" I am referring to all GMO companies.

Monsanto claims that humans have been practicing genetic modification on plants and animals for millennia, and what they are doing is no different. This claim is correct if by "genetically modify" you mean do cross/selective breeding. However, there is no way you can cross breed a fish with a tomato by traditional techniques. Monsanto has tried to conflate the two.

Drug companies that develop new drugs are expected to prove, firstly that the drugs are safe with mimimal side effects, and secondly that they are effective. We should not accept a process where new drugs are marketed and sold with the understanding that it is up to others to prove their safety. We've seen that even with such a system, dangerous drugs still make it to market (even when the drug companies knowingly hide the hazards). Also, repeated defunding of the FDA makes independent testing difficult. We should expect the same protection for GMO foods.

When the Monsanto resorts to fear mongering (massive increases in grocery costs due to restrictive new labeling laws), doubt (their "completely unbiased" studies show no danger) and out-and-out lying (illegally using government logos on advertising) instead of rationally defending their position with facts it makes it hard to believe anything that they say about the safety of their products.

When Monsanto says "GMO products are safe" they have a vested interest in the acceptance of that statement. When an independent labs say …

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

What do you mean by html image?

By get do you mean save, retrieve, download or what?

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

I'm not patting myself on the back. I'm simply speaking from the point of view of someone who, over the last 35 years has seen an awful lot of sizzle but not a lot of steak to go with it.

You have every right to be offended, just as we have every right to our opinions.

<M/> commented: Yep, straight to the point +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It reminded me of season 1 of Silicon Valley where, at the tech gala, every presenter claimed that their software would "change the world". BUT WAIT!!!, if you buy now you can get TWO world changing software packages for the same low, low price of just three easy payments of $19.95 (a $400 value). Order now.

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

You are not using IIF correctly. You can not execute statements within an IIF. For example

Dim a As Integer = 1
Dim b As Integer = 2
Dim c As Integer = 3

IIf(a = 1, b = 7, b = 8)

b will still have the value 2, however, if you do

b = IIf(a = 1, 7, 8)

then b will have the value 7. You could rewrite your statements as

If Me.cmbwkdays.SelectedItem = Nothing) Then
    Cmd.Parameters.AddWithValue("@DayNos", "N/A")
Else
    Cmd.Parameters.AddWithValue("@DayNos", Me.cmbwkdays.SelectedItem)
End If

or you could do

Dim temp As String = IIf(Me.cmbwkdays.SelectedItem = Nothing, "N/A", Me.cmbwkdays.SelectedItem))
Cmd.Parameters.AddWithValue("@DayNos", temp)

Also, I counted twice but it looks like you have 29 field names and 29 AddWithValue statements but only 28 "?".

Santanu.Das commented: I'm grateful to you for all your help. +5
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The first problem is that you have a field name with an embedded blank. The field is Message status. There are two ways to fix this. One way is to always refer to the field as [Message status]. A better way is to rename the field to either MessageStatus or Message_status. Same problem for Date and time.

The second problem is that you built the query string but you didn't execute it. Try adding

cmd.CommandText = query
cmd.ExecuteNonQuery()

The third problem is that different field types use different delimiters. Numeric fields do not require delimiters. Text fields must be surrounded by single quotes. I believe MS Access uses a pound sign to surround datetime fields. However, if you use parameterized queries the proper delimiters will be added for you. Also, quote marks in text fields will be handled without any extra code on your part.

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

I used to go and sit on the beach at Brighton and dream, and now I sit on the shore of human life and dream practically the same dreams. I remember about the time that I mention – or it may have been a trifle later – coming to the distinct conclusion that there were only two things really worth living for – the glory and beauty of Nature, and the glory and beauty of human love and friendship. And to-day I still feel the same. What else indeed is there? All the nonsense about riches, fame, distinction, ease, luxury and so forth – how little does it amount to! It really is not worth wasting time over. These things are so obviously secondhand affairs, useful only and in so far as they may lead to the first two, and short of their doing that liable to become odious and harmful. To become united and in line with the beauty and vitality of Nature (but, Lord help us! we are far enough off from that at present), and to become united with those we love – what other ultimate object in life is there? Surely all these other things, these games and examinations, these churches and chapels, these district councils and money markets, these top-hats and telephones and even the general necessity of earning one’s living – if they are not ultimately for that, what are they for?

Edward Carpenter

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

Yeah. It was ambiguous but considering that the number of displayed lines would vary depending on the size of the form I assumed hard terminated lines as the more likely scenario.

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

Chinese hackers now have information on 18 million US government employees. This information contains details relating to drug abuse, gambling problems, debts, marital troubles, criminal activity, sexual preferences and sexual fetishes. Sourse

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

@rproffitt - the code I suggested allows all of that. It says only to disallow any ENTER keys if already at the max allowed. All other keystrokes are still allowed.

@satyam_1 - please explain how the code does not meet your needs and I will try to modify it accordingly.

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

Here is an OleDB example using a sample database with fields of type int, int, varchar(50, int.

Dim con As New OleDbConnection("Provider=SQLNCLI10;Server=.\SQLEXPRESS;Database=mydb;Trusted_Connection=Yes;Connect Timeout=15;")
con.Open()

For Each item As ListViewItem In ListView1.Items

    Dim cmd As New OleDbCommand("", con)
    cmd.CommandText = "INSERT INTO teams " &
                        "(recordID, OrgID, Team, boolIsActive) " &
                    " VALUES(" & item.SubItems(0).Text & " ," &
                    "        " & item.SubItems(1).Text & " ," &
                    "       '" & item.SubItems(2).Text & "'," &
                    "        " & item.SubItems(3).Text & ")"

    cmd.ExecuteNonQuery()

Next

con.Close()

This example illustrates the INSERT syntax but you should really use a Parameterized Query which is a little more trouble to set up but worth it for the extra protection.

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

Have you tried stepping through the code in the debugger?

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

You need to use the same variable for the return value as well as the test. You used responce to save the result but your test uses reply. Another possibility would be

If MsgBox("Are you sure you want to Logout?", vbYesNo, "Confirmation") = vbYes Then
    Unload Me
    frmAuthentication.Show
else
    exit sub
End If
Nutster commented: That is the version I use. +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sorry. Didn't check the modified query. You have to also select Fullname, not just EmpID. You can only reference columns that you have selected.

selectQuery = "SELECT EmpID, FullName...
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In that case try

If dr.Read Then
    txtEmpName.Text = dr("FullName")

Keep in mind that because you are doing a "Like" in the select query you may end up with more than one matching record (depending on whether txtEmpId.Text contains wildcards)

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

Your query is

"SELECT * FROM EmployeeRegistration WHERE EmpID Like '" + txtEmpId.Text + "' AND FullName = '" & txtEmpName.Text & "'"

so you are going to select based on an employee ID and full name that you already have displayed. If you already have the full name why do you need to redisplay it from the database?

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

Ah. I see. I was in the actual thread. That does seem to be a bug.

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

In the early 1990's a biotech cmopany in Europe was prepared to mass-market a bacteria intended to decompose plant litter in soil. Independent researchers, however, determined that it would, instead, kill all terrestrial based plant life. Source

Monsanto's current position on GMOs is that it is up to others to prove that they are unsafe, not Monsanto to prove that they are safe.

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

I see the last post as coming from you.

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

You already have the employee ID in txtEmpId and the employee name in txtEmpName before you click SEARCH. What am I missing?

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

Try the KeyDown event instread

Private Sub RichTextBox1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox1.KeyDown

    If e.KeyCode = Keys.Enter And RichTextBox1.Lines.Count = MAXLINES Then
        e.SuppressKeyPress = True
    End If

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

Mine came with Windows 7 Home Premium pre-installed. I had the option of Windoes 7 or Windows 8. I preferred to have an OS that has had some of the bugs fixed. I'm not going to get into a Windows 8 is/isn't a complete turd ball debate.

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

If you make a mistake, own it. When you apologize, make it sincere. Trust me, I've had a lot of practice at this.

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

Slno always starts at one so I suggest you make this an identity field (auto-number) and do the inserts in one statement like

INSERT INTO table2 (Accountno, Narration, ...)
 SELECT Accountno, Narration, ... FROM table1 
  WHERE TranNature = 'C'
  ORDER BY serialno

You'd have to do some playing with this to get the exact query.

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

This has been a problem for months. I didn't notice it at first because I didn't do video for the first couple of weeks. I reported this as a problem to Dell when I noticed it but I got stuck in Dell Hell and finally said fuck it. Dell Hell consists of getting repeatedly forwarded to the US office (even though I connect to Dell.ca and follow the links from there) where I am told "we don't recognize your service tag. Did you buy the laptop from another country?" Following that, due to some medical issues, I let it slide until now.

I just heard from Intel and they suggest installing a non-customized driver from them. Unfortunately, the standard driver install just reports "not valid for your hardware". My Dell warranty covers only hardware so Dell wants me to pay for them to fix a bug in their driver.

Here's the amusing part (if anything about this can be considered amusing). My warranty covers accidental damage. That means if I drop the laptop it will be repaired at no cost to me. I asked the Dell tech "so if the laptop is damaged beyond repair it will be replaced?". She replied "we will attempt to repair it first." I repeated the question three times with "but if it can't be repaired it will be replaced?" and got the same answer each time. Obviously if they have to replace the laptop and the new one exhibits the same behaviour it could …