SETHA SITE INFORMATION

  • Increase font size
  • Default font size
  • Decrease font size
SETHA SITE INFORMATION

How to Set Database Password in Microsoft Access 2007

E-mail Print PDF
This article shows you how to set database password in Microsoft Access 2007 whether its format is *.mdb or *.accdb.
  1. Open existing database or create new database (.mdb or .accdb)
  2. Click on Database Tools tab
  3. Click on Set Database Password

    If you have problem here, please follow instructions below:
    1. Click on Microsoft Office Button
    2. Click on Close Database
    3. Click on Microsoft Office Button again
    4. Click Open Under the Office Button (Open Dialog Windows is Appeared)
    5. Choose database file (eg. ...\bin\debug\data.mdb)
    6. Click the Drop-down of Open Button
    7. Choose Open Exclusive
  4. Click on Database Tools -> Set Database Password
  5. One Dialog appears for you to set password (Enter your password)
  6. Done
 

Export Data from DataGridView in VB 2008 to Microsoft Excel

E-mail Print PDF

This article show you how to write Visual Basic .Net 2008 code to export data from DataGridView control into Microsoft Excel. From this article you will know how to:

  • How to use Add Column and Add Data into DataGridView Control (Using DataGridView in VB2008)
  • How to Export Data to Excel from DataGridView in VB2008
  1. Add Column and Data to DataGridView
    Dim ind As Integer
    With Me.DataGridView1
       .Columns.Add("id", "ID")
       .Columns.Add("name", "Name")
       .Columns.Add("gender", "Gender")
       '
       .AllowUserToAddRows = False
       .AllowUserToDeleteRows = False
       .EditMode = DataGridViewEditMode.EditProgrammatically
       '
       For i As Integer = 1 To 10
            ind = .RowCount
            .Rows.Add()
            With .Rows(ind)
                 .Cells("id").Value = i
                 .Cells("name").Value = "Name" & i
                 .Cells("gender").Value = "M"
            End With
       Next
    End With
    

  2. Export data from DataGridView to Microsoft Excel
    Dim ExcelApp As Object, ExcelBook As Object
    Dim ExcelSheet As Object
    Dim i As Integer
    Dim j As Integer
    
    'create object of excel
    ExcelApp = CreateObject("Excel.Application")
    ExcelBook = ExcelApp.WorkBooks.Add
    ExcelSheet = ExcelBook.WorkSheets(1)
    
    With ExcelSheet
         For i = 1 To Me.DataGridView1.RowCount
               .cells(i, 1) = Me.DataGridView1.Rows(i - 1).Cells("id").Value
               For j = 1 To DataGridView1.Columns.Count - 1
                   .cells(i, j + 1) = DataGridView1.Rows(i - 1).Cells(j).Value
               Next
         Next
    End With
    
    ExcelApp.Visible = True
    '
    ExcelSheet = Nothing
    ExcelBook = Nothing
    ExcelApp = Nothing
    

Download Sample Code Here
 

Brick Game

E-mail Print PDF
This game is developed in Turbo C++ programming language. It works well with old version of Microsoft Windows Operating System such as Windows XP, Windows Me, Windows 98.

Download Software Here
 
How to get this game into your OS? You just download above file and extract it into your selected folder and double click on the .exe file.
Download Source Code
 

How to change screen resolution using Visual Basic 6?

E-mail Print PDF

This sample show you how to write Visual Basic 6 (VB6) code to change screen resolution (example: change screen resolution to 1024x768). You will see the uses of API function as follow:

Public Declare Function GetSystemMetrics Lib "user32.dll" .................
Public Declare Function EnumDisplaySettings Lib "user32.dll" ................
Public Declare Function ChangeDisplaySettings Lib "user32.dll" ............
Public Declare Function ExitWindowsEx Lib "user32.dll" .........

Download Sample Here
 

How to Save Image into MS-Access 2003 from Visual Basic 6?

E-mail Print PDF
This article is a sample of saving image from Visual Basic 6 into Microsoft Access Database.
  • Create New Project in VB6: Project1
  • Create New Form: Form1
  • Draw Controls on Form as following:
    • One TextBox Control
    • One Image Control
    • Two Command Controls for Save and Close
    • Two Command Controls for Browse and Remove Image
    • One Command Control to Get data back from Database with the text enter TextBox Control
  • Add Component: Microsoft Command Dialog Control 6.0
  • See Image below
  • Add Reference: Microsoft ActiveX Data Objects 2.1 Library (Project->References)
  • Create Database in Microsoft Access (data.mdb) with the following table:
    • Table name: student
    • Fields
      FieldData Type
      nameText
      photoOLE Object
  • Coding (Download sample below)

Download Sample Code Here
 


Page 13 of 19