Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can VB read code from a notepad file?

Status
Not open for further replies.

dedo8816

Programmer
Oct 25, 2006
94
0
0
GB
Probably a stupid question, but can i create a form and put the program code into a notepad file and have VB use the code in the file to run the program?

Just asking as sometimes it would be much easier than reprogramming and recompiling.

Would be good to know

D
 

That's not a stupid question, but you should be more specific of what you want your program to do, what changes (code) do you want to incorporate in Notepad?

I had a simple program to check whole bunch of stuff in the data base, and I had to add/recompile it often. Then I just created a simple text file with my Select statements in it and read this file from my VB program. If I needed to make any changes, modifications, additions, etc. I just changed my txt file and never had to recompile my progrtam again.

Have fun.

---- Andy
 
its a simple program that searchs serial numbers in a database and displays the information for users in a warehouse to find product without having to use a stupid cheap system the company wont improve that ofter crashes. The information can then be used to print 4" x 4" labels without ever having to actually use the other system.
It works great already but whenever i need to make improvements or adjust code i have to consistantly recompile and replace all .exe's on all the computers in the warehouse. Just a bit of a pain thats all...
Would be handy to put a txt file in a shared location and have the program pull its functionality from that file in 1 location.
How did you go about doing this?
 
>Would be handy to put a txt file in a shared location

Why not develop a solution that allows the the exes to be used from a shared location instead?
 

I used to do exactly what strongm suggests: have an EXE on a server, and point to it from any computer. Users only care of where the shortcut is on their desktop, they don't care where acctual program is. If the only piece is the EXE that you need to replace, it looks to me that you do not need any updates to the installation package, if you have any.

Place EXE on the server, delete the one from your machine, point to that EXE and... be happy. :)

Do the same to others' computers. You'll love it.

Have fun.

---- Andy
 
Correct me if I'm wrong... If you have the exe on the server and someone (even one person) is using it, you will not be able to replace it. Everyone will need to close the app before you can replace it. This is certainly a lot easier than going to each computer to replace it, but it is something to be aware of.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 

I have this problem with replacing the file if someone is using it. So I have a little VB program that renames the EXE to something with the date in it (MyExe_3-15-2012.EXE), and renames another file (New.EXE) to whatever I want to. This little program is scheduled to run at midnight in Task Scheduler - nobody should be accessing this exe file at this time, I hope - and if successful, I send myself an e-mail about it. If there is any error, I e-mail myself the error. So in the worse case users have to wait until next day to get the updates.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top