Tuesday, September 21, 2010
Sink the Bismarck
Labels:
Downloads,
game,
JAVA,
Programming,
sink the bismarck
Tuesday, August 24, 2010
Sunday, April 25, 2010
Basic Backup and Restore for MS SQL Server 2000
Here is a simple tutorial for backup and restore in SQL Server 2000. This tutorial covers the basic procedures in creating backup and restoring databases. In this tutorial, we will be using Northwind Database as our example since it available on the sample databases of SQL Server

Before we backup our database, we have to create a logical backup device for our database.
On the query analyzer, make the database in use by selecting it on the drop down menu or by executing the code:
Now we will create our logical backup device. Make sure the path exists when you execute this. If you execute this without errors it means that you are doing right.
After successful execution, you cannot run this code again since it already exists1
Then we will now backup our database with the following code:
As I said(or typed :o)) earlier, you should make sure that the path you created exists2.
Now we will restore are database based on the backup file we have created.
Notes:
1"Honestly, I haven't figured out yet how to alter that logical backup thing but please stay tuned for updates. You can also post some suggestions for this"-jereme
2. Tip: Or at least tell your front end application to create folders if it does not exist.
Backup
On the query analyzer, make the database in use by selecting it on the drop down menu or by executing the code:
Use Northwind
Now we will create our logical backup device. Make sure the path exists when you execute this. If you execute this without errors it means that you are doing right.
EXEC sp_addumpdevice 'disk', 'NWINDBackup', 'c:\NorthwindSystems\Backup\NWind_backup.bak' --NWINDBackup will be the name of our logical backup drive
After successful execution, you cannot run this code again since it already exists1
Then we will now backup our database with the following code:
As I said(or typed :o)) earlier, you should make sure that the path you created exists2.
BACKUP DATABASE Northwind TO NWINDBackup
Restore
Now we will restore are database based on the backup file we have created.
RESTORE DATABASE Northwind FROM NWINDBackupThe syntax follows as:
RESTORE DATABASE [your db name] FROM [logical drive]
Notes:
1"Honestly, I haven't figured out yet how to alter that logical backup thing but please stay tuned for updates. You can also post some suggestions for this"-jereme
2. Tip: Or at least tell your front end application to create folders if it does not exist.
Friday, April 23, 2010
Opening Another Program in VB.NET
Hey I got this code from the website www.dreamincode.net/forums
This can be useful in opening other applications (especially Microsoft VB.NET applications). The problems is that there are chances of error especially when the program is missing, or the program has been moved.
As a solution to that problem, I suggest that you would make the separate application relative to your executable file so that
moving the whole project to another location whould not affect the path you specified.
Your file path should look like this.
Just make sure that the program is located beside the program you are debugging.
You can do this by adding another project as a reference to your main project so that everytime you compile, the executables automatically
proceed to the bin where they would reside as they are executed.
To add a refecence, you can follow these steps:
If the other program (VB Project) is not yet part of the Solution:
1. go to File > Add Existing project
2. Then select the project file of the program you want to link it with.
You will notice in the solution explorer that another project is added.
Now, you can make that program part of the main program by adding it as a reference.
On your solution explorer, right click your main project, Choose Add reference.
As the add reference dialog opens, choose projects then select the project file of the other program.




Try Dim p As New System.Diagnostics.Process 'the location of your program p.StartInfo.FileName = "K:\Uni\Year 2\Visual Basic\Report\MSDN\Absolute Beginner's Series VB Lesson 1\01 VB Code\Lesson01\HelloWorld.exe" p.Start() Catch ex As Exception MsgBox("Error - " + ex.Message) End Try
This can be useful in opening other applications (especially Microsoft VB.NET applications). The problems is that there are chances of error especially when the program is missing, or the program has been moved.
As a solution to that problem, I suggest that you would make the separate application relative to your executable file so that
moving the whole project to another location whould not affect the path you specified.
Your file path should look like this.
p.StartInfo.FileName = "Your Program.exe" 'your relative path, no need to include the drive location for portability
Just make sure that the program is located beside the program you are debugging.
You can do this by adding another project as a reference to your main project so that everytime you compile, the executables automatically
proceed to the bin where they would reside as they are executed.
To add a refecence, you can follow these steps:
If the other program (VB Project) is not yet part of the Solution:
1. go to File > Add Existing project
2. Then select the project file of the program you want to link it with.
You will notice in the solution explorer that another project is added.
Now, you can make that program part of the main program by adding it as a reference.
On your solution explorer, right click your main project, Choose Add reference.
As the add reference dialog opens, choose projects then select the project file of the other program.
Thursday, April 8, 2010
Query Displayer JAVA Program
As a continuation for my earlier post in JDBC, here is a sample program I got from Java™ How to Program, by H.M. Deitel,
It looks like a query analyzer. You can use this to test the retrieval of data.
You can download the source at:
Query Displayer.zip
Just modify the following lines of code on DisplayQueryResults.java
For a copy of the ebook Java how to Program, visit
javaforbidden.4shared.com
The password is: itspot
(shhh... please don't tell them about this, ok?)
It looks like a query analyzer. You can use this to test the retrieval of data.
You can download the source at:
Query Displayer.zip
Just modify the following lines of code on DisplayQueryResults.java
static final String JDBC_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver"; static final String DATABASE_URL = "jdbc:odbc:NWIND"; static final String USERNAME= ""; static final String PASSWORD= ""; // default query selects all rows from authors table static final String DEFAULT_QUERY = "SELECT * FROM Products";
For a copy of the ebook Java how to Program, visit
javaforbidden.4shared.com
The password is: itspot
(shhh... please don't tell them about this, ok?)
Saturday, April 3, 2010
STEPS IN INTEGRATING HELP FILE IN YOUR VB.NET APPLICATION
1. Place this code inside your sub-menu (when clicked under main menu or button if you choose it instead). Make sure you follow the syntax below:
Help.ShowHelp(Me, [url]);
- Since you use VB as programming language, it should be 'Me' not 'this' because ‘this’ is for C#. By the way, what does it mean is ‘Me’ is your main form which will become the parent of the newly opened help file (in your case, your pdf file).
- Next parameter is ‘url’. In this type of parameter, it requires you to input the whole directory together with your pdf file.. For example, your help file is sample.pdf located at 'c:\program files\system'. Just add sample.pdf at the end of 'c:\program files\system' which becomes 'c:\program files\system\sample.pdf'.
So the final output of your ShowHelp() method is:
Help.ShowHelp(Me, "c:\program files\system\sample.pdf");
But there is one problem on this method if you install it in your client's computer; there is a possibility that his/her computer’s directories are different from yours. So if that's the case, follow this:
1. Place your sample.pdf file inside your project's bin-->debug folder (and bin-->release folder if there is) found in your project folder.
2. Then change your code into this
Help.ShowHelp(Me, Path.GetFullPath("sample.pdf"))
For example this is your whole code
--> You need to import System.IO at the top of your code, like this
Imports System.IO
NOTICE:
- This tutorial will work only in Microsoft Visual Studio esp. 2008 (not sure in 2003 and 2005 because I used Path class which I don’t know if existing in .NET 1.1 and .NET 2.0). 2008 uses .NET 3.5.
- I notice that chm, doc and pdf files will open once after clicking the button or submenu under main menu while txt will open as many times you click it.
Hope that helps! =) Always here to post useful tutorials for you guys!
Subscribe to:
Posts (Atom)