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

I've never tried it on an Access database. I suggest you create a dummy table and try it out.

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

Try

IF OBJECT_ID('myTable','U') IS NOT NULL DROP TABLE myTable
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

30C? Not for a while here yet I'm afraid. +8C was the best we could do. Sloppy enough that you sink to your waist in the snow.

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

Saying "X is two times more expensive than Y" is possible, but means something else

When I argue that exact point the response I usually get is "you should know what I mean when I say...". It's frustrating. I know someone who says "scroll up" when she wants me to scroll down. Her logic is that the text is moving up the screen so "scrolling up" is the correct phrase. The fact that "scrolling down" means something else to virtually every other computer user on the planet is irrelevant. Aaaaarrrggghhhh!

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

Go ahead and ask.

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

Do you think I have an obsession or a passion with tech and software?

Yes. Yes, I do ;-P There is a fine line between technophilia and technomania. I had a friend who claimed to be a pyrophile. A nudge in the wrong direction however...

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

I would use 'fold' instead: "B is three-fold more exprensive than A"

And that gets us back to an earlier post. Let's assign some numbers. If A costs 4$ and B is three-fold more expensive, does that mean B is $12 or $16? Three times as expensive would be $12 but three times more expensive to me means $16 because times is a multiplier and more means "in excess of".

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

cheaper just means it costs less mony than something else

Agreed, but how do you quantify how cheap something is? Reconsidering my previous post, to be technical you probably cannot say A is twice as expensive as B. I suppose you should instead say A costs twice as much as B.

"A is three-fold cheaper than B"

My point was that if the cost of A is a fraction of the cost of B then you can't use three-fold in comparing A to B. If you had two poles, a two-footer and a six-footer would you say the shorter pole is three times as short as the longer? Of course not. And for the same reason that you would not say a pole is two feet short. You would say a pole is two feet long - unless you needed a four foot pole and you only had a two foot pole in which case you would say the pole is two feet short (of what you need it to be). You measure how long (or tall) something is, not how short it is.

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

Do all of the tables have the same structure? What is that structure? Are you getting any error messages? Try changing

qry = "INSERT INTO [ptempTable] ([project number],[project name],[description]) VALUES ('" & projcode & "','" & projname ,"'" & description & "')"

to

qry = "INSERT INTO [ptempTable] ([project number],[project name]," &
      "[description]) VALUES ('" & projcode & "','" & projname & "','" & 
      description & "')"

It looks like you have a formatting error between projname and description. Are you using OleDB, or SqlDB? If you use parameterized queries you would be less likely to see these types of formatting errors. Please see here for examples of both.

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

Here's a bonus one I came across today. A company claims to have a process for producing solar cells that is three times cheaper than existing technology. I don't see how one thing can be "three times" cheaper than another thing. If item A costs one dollar and item B costs three dollars than item A is one third as expensive as item B, and conversely, item B is three times as expensive as item A, but item A can not be said to be three times cheaper than item B.

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

Here's a new one - the difference between further and farther. Further is synonymous with additional. You would say "further study is needed" but not "She lives further away". You would instead say "she lives farther away". Farther is used for distance.

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

I guess the PQ learned a hard lesson about trying to push a referendum on people who quite obviously are not interested.

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

I know what that's like. We had clods living next door to us at the cottage. Once they moved away the climate improved considerably.

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

It might help if you posted the error message and number. What version of Windows are you running?

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

I hear it's 100x more secure than XP

How would you even measure that? That sounds like a blanket statement made by someone who is just pulling numbers out of his a$$.

Because MS plans to implement updates designed to turn Win 7 into what he called 'Win 8 lite'

That will never happen because Microsoft would face massive lawsuits from millions of corporate users.

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

I'm in Winnipeg and it was t-shirt weather today (in spite of the several feet of snow on the ground). It was +5C and sunny.

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

You'll have to try explaining again. Your description is very confusing.

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

You can make the code a lot cleaner and safer by using Parameterized queries. Here is an example using your INSERT

cmd.CommandText = "INSERT INTO Product ([Item ID], [Item Name], " &
                  "[Item Type], [Quantity], [Min Shelf Stock],  " &
                  "[Purchase Price], [Note])  " & 
                  "VALUES (?, ?, ?, ?, ?, ?, ?)"

cmd.Parameters.AddWithValue("@p1",txtItemID.Text)
cmd.Parameters.AddWithValue("@p2",txtItemName.Text)
cmd.Parameters.AddWithValue("@p3",cboItemType.Text)
cmd.Parameters.AddWithValue("@p4",txtQuantity.Text)
cmd.Parameters.AddWithValue("@p5",txtMinShelfStock.Text)
cmd.Parameters.AddWithValue("@p6",txtPurchasePrice.Text)
cmd.Parameters.AddWithValue("@p7",txtNote.Text)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There are examples here for both OleDB and SQLDB. Just modify the code to add the items to a listbox instead of a listview.

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

but with the fact that 7 is just designed for noobs

Yeah. My father-n-law finds that it is much easier to screw up his computer under Windows 7 then it was under XP :-( Fortunately, with disk imaging, it doesn't take any longer to get him back up again.

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

The only problems I have had are with drivers for an old Lexmark printer and a Plextor USB TV tuner. I do not agree that XP is "so much better to use". I don't expect vendors to release drivers for all of the hardware for all future versions of Windows.

Tcll commented: good point, and I agree +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I've never had the need to use databound controls so I can't offer any help in that area. As for applying the code to 20 checkboxes, you'll want to have a separate block for each checkbox as in

Dim query As String
Dim cmd As New OleDbCommand("", con)

query = "INSERT INTO Table1 (ID,Age,Hb) VALUES('" & IDtxt.Text & "','" & Agetxt.Text &
    "','" & IIf(Hbtxt.Checked, Hbtxt.Text, "") & "')"
cmd.CommandText = query
cmd.ExecuteNonQuery()

query = "INSERT INTO Table1 (ID,Age,TC) VALUES('" & IDtxt.Text & "','" & Agetxt.Text &
     "','" & IIf(TCtxt.Checked, TCtxt.Text, "") & "')"
cmd.CommandText = query
cmd.ExecuteNonQuery()

etc.

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

I still use Office 2003. The newer versions all have "the ribbon" which I hate passionately.

Tcll commented: I know that feel +2
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Unless cmd is declared outside the If-Then-Else it goes out of scope once you try to execute it. You could try the following

Dim query As String = ""

If Hbtxt.Checked Then
    query = "insert into Table1 (ID,Age,Hb) " &
            "values('" & IDtxt.Text & "','" & Agetxt.Text & "','" & Hbtxt.Text & "')"
Else
    query = "insert into Table1 (ID,Age,Hb) " &
            "values('" & IDtxt.Text & "','" & Agetxt.Text & "','')"
End If

If TCtxt.Checked Then
    query = "insert into Table1 (ID,Age,TC) " &
            "values('" & IDtxt.Text & "','" & Agetxt.Text & "','" & TCtxt.Text & "')"
Else
    query = "insert into Table1 (ID,Age,TC) " &
            "values('" & IDtxt.Text & "','" & Agetxt.Text & "','')"
End If

cmd = New OleEDbCommand(query, con)
cmd.ExecuteNonQuery()

You didn't say how it isn't working. If you are getting an error message then please post it. I have a couple of other suggestions. Please add

Debug.WriteLine(query)

just before you do ExecuteNonQuery and post the results. Are TCtxt.Checked and Hbtxt.Checked mutually exclusive? If not then this code may not do what you want. Also, please see how to use parameterized queries.

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

If all values in that column have the same value (zero) then sorting on that column won't do much. Here is an example of sorting on two columns using the PUBS sample database

SELECT * FROM authors
 ORDER BY au_lname ASC, au_fname DESC

It sorts first by author last name (ascending), then by first name (descending).

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

Post the contents of the manifest file here.

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

Never ever use 'sa' for anything other than db administration. You can create a user/password by

CREATE LOGIN [appUsername] WITH PASSWORD=N'appPassword',
    DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english],
    CHECK_EXPIRATION=ON, CHECK_POLICY=ON

You'll still have to assign access rights/roles for the new user. It is easier to manage SQL if you download (free) and install SQL Server Management Studio.

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

The easiest way is

For Each filename As String In System.IO.File.ReadAllLines(MyFile)
    MyCustomSub(filename)
Next

Just add your file processing code in MyCustomSub. Some people would suggest you use a StreamReader but the file would have to be enormous before memory is a consideration and the above method means you don't have to bother checking for things like end of file. The code is clear and straightforward.

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

You haven't said whether you are on a domain or a workgroup or whether both computers are in the same domain/workgroup. I suggest you try SQL authentication (SQL username/password) and see if you get connected that way. If it works then you can try the other method later. Can you at least ping the server from the other PC?

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

I'd look for another vet. That's an absurd price.

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

Compare the cost and capabilities of today's hardware with what was available in, say, 1995. Now adjust for inflation. I use the RBC Calculator. How much cheaper and efficient do you want?

You ask for innovation but you do not define what that is. That would either be "give me stuff that no one has thought of before" (the definition of innovation) or "give me stuff that I've thought of but won't tell you what it is".

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

There are a thousand ways that an application can "not work". What happens when you run it?

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

You can connect to the server using Windows Authentication or SQL Authentication. The first method uses the Windows logon ID and assumes that both computers are in the same domain or workgroup. the second uses a userid and password defined by the SQL dbadmin. For either method you also have to be able to ping the server. If you are using Windows Authentication your connection string looks like

Server=SERVERADDRESS;Database=DATABASE;Trusted_Connection=True;

For SQL Authentication it is

Server=SERVERADDRESS;Database=DATABASE;UserId=USERNAME;Password=PASSWORD;

Replace the upper case values with your values.

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

I suppose, given a choice, I would rather have snow than tornados. We had an F5 tornado about 30 miles out of town in 2007 but that sort of thing is pretty rare here.

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

More (rude gerund) snow!

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

That is true but the point was that if the dog's ears fold down then they are more likely to get dirty and infected. If they stand up (for whatever reason) then they will stay dry.

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

You can try equal parts of vinegar and warm water. Use cotton balls (not Q-Tips).

@AD - Ew!

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

You can't just swap system disks. The OS was installed for specific hardware and will have drivers for that hardware. Even if you got installation media with those computers (and not just the usual restore disks) they will be OEM disks and will likely not be usable on another computer.

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

As you've heard several times over, take your dog to the vet. He/she can check for infection and suggest a cleaning solution which should be used on a regular basis. Dogs with floppy ears like setters, spaniels, basset hounds, etc. tend to be more susceptible to this problem because the ears stay more moist. We had to swab our Irishes regularly. Our Shepherd/Husky cross never had this problem.

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

Have you taken into account the pollution caused by the production and transportation of the fossil fuels? And not just the normal case but the pollution caused by spillage?

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

You might try strings.exe from the free Sysinternals Suite. This may allow you to recover all/most/some of the text.

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

At least for today, my favourite word is "banned".

pixelsoul commented: genius +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you aren't sure then I suggest you put it on a USB stick and try it before you start burning.

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

If the database is in the same place (GEN-PC) and the other computer has access rights then you shouldn't have to change the connection string.

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

Glad to help.

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

To copy from array1 to array 2 do

For i = 0 To 4
    array2(i) = array1(i)
    array2(i+5) = array1(i)
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you are adding multiple textboxes at design time then the IDE will assign sequential names by default whether you drag and drop or copy/paste.

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

Why does the DB server have to be on the factory floor where all the vibration is occurring? And if it is a requirement for some reason, there are ways of isolating the server by placing it on a base that will dampen the vibrations.

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

Here's an example. I created a blank form, added a picturebox, then added a label at the centre of the picturebox. Note that even though the label is over the picturebox, it is actually containied in Me.Controls. In the following code, only the line that has the comment "run time" actually has to be in the code. The other three lines set properties that can be set in the designer. This code gets executed when the form loads and does not require that you click on anything.

Public Class Form1    

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Me.BackColor = Color.Azure             'design time
        PictureBox1.BackColor = Color.Coral    'design time
        Label1.BackColor = Color.Transparent   'design time
        Label1.Parent = PictureBox1            'run time

    End Sub

End Class

Your problem was that when you double clicked on the picturebox in the designer it automatically created a handler for PictureBox1_Click. That is where you added your code and that is why you had to click on the control to execute that code at run time.

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

And if you want to attach event handlers to the textboxes just do

AddHandler <event>, AddressOf <subname>

as in

AddHandler TextBox1_TextChanged, AddressOf MyHandlerSub
.
.
.
Private Sub MyHandlerSub(sender As System.Object, e As System.EventArgs)

You can assign the same handler to all of the textboxes. Just make sure you can tell which one triggered the event by assigning unique names or setting an appropriate value for the Tag property.