about-knowledge.com

rss

Database Programming Using VB 6.0 (Part Three)

without comments

Data Environment Designer

These are the steps to connect VB 6.0 with MS SQL server database using Data Environment Designer method. Data Environment Designer also helps us to generate a report using Data Report control.

  • Data Environment Designer helps the programmer to develop database connection Prototype applications rapidly in Visual Basic.

  • Start a new standard EXE project.

  • Click to Add ‘Data Environment Designer’ after selecting ‘Project’ menu from the menu bar.

  • Click on the properties after selecting the ‘Connection1′ icon. Select the MS SQL server driver, server and database, as is done for ADO control method. Press OK button on the test connection message. Press OK button on the data link connection window to complete the database connection procedure, as is done for ADO control method.

  • Click the ‘Add Command’ option from the pop up menu using the mouse click event after selecting the ‘Connection1′ icon.

  • Click on the properties after selecting the ‘Command1′ icon.

  • Select ‘Table’ as database object from the first combo box and ‘BookRecord’ as object name from the second combo box. Press ‘Apply’ and then ‘OK’ buttons.

  • Select ‘Expand All’ option using the mouse right click event to view all fields from the database.

  • Drag the ‘Command1′ icon on the ‘Form1′ window to design the interface. Text and label boxes required to design the interface will automatically drawn.

  • Drag the number of command buttons to search the record, such as move first, move next, move previous and move last.

  • Click to Add ‘DataReport1′ after selecting ‘Project’ menu from the menu bar.

  • Select the ‘DataEnvironment1′ from the ‘DataSource’ and ‘Command1′ from the ‘Datamember’ properties by using the properties windows of the ‘DataReport1′.

  • Drag ‘Command1′ on the ‘Detail Section1′ part of the ‘DataReport1′ to design the report.

Data Wizard Method

These are the steps to connect the VB 6.0 with MS SQL server using Data Wizard method:

  • Start a standard executable project.

  • Click on the ‘Add Form’ by using the mouse right click event after selecting the project window.

  • Select the ‘VB Data Form Wizard’ icon and press ‘Open’ button.

  • Press the ‘Next’ button to select the ‘Remote(ODBC)’ from the list.

  • Press ‘Next’ button after selecting the SQL server driver and entering username, password and server name.

  • Press ‘Next’ button to select the form layout and ADO control.

  • Select ‘BookRecord’ table from the ‘RecordSource’ combo box. Press the arrow button to convert ‘Available Fields’ into ‘Selected Fields’.

  • Press the ‘Next’ button.

  • Press ‘Next’ button if developer wants all controls already checked.

  • Press the ‘Finish’ button to complete the wizard.

  • Press ‘OK’ button to complete the wizard.

  • Select the ‘wizardfrm’ Form as a start up object after clicking on the ‘Project1 Properties’ from the ‘Project’ menu.

Open Database Connectivity (ODBC) Method

ODBC is an application-programming interface used to connect the database. SQL is used to access the data from the database. Data Source Name (DSN) and DSN less are two methods to connect the database using ODBC. Using ODBC method does not normally develop prototype programs.

Bookmark and Share

Related posts:

  1. Database Programming Using VB 6.0 (Part Two) ActiveX Data Object (ADO) Control Method These are the steps...
  2. Database Programming Using VB 6.0 (Part One) There are five main methods to connect the database using...
  3. Menu Programming and Multiple Form Programming Using VB 6.0 Menu Programming Using VB 6.0 A menu is a collection...
  4. VB 6.0 Programming and Integrated Development Environment of VB 6.0 VB 6.0 Programming Visual Basic (VB) was evolved from the...
  5. Programming of Facts Programmer declares Facts by writing Predicate first and then fact...

Written on

May 13th, 2009 at 10:39 pm