English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

There is one access database d1.mdb in which emp is a file with fiels:emp_name, basic, tax. Now the front end vb form has a button CALCULATE. The program should be : if this button is clicked, the TAX fiels of the database would be calculated by BASIC X 0.30

2007-04-13 18:52:37 · 3 answers · asked by The Dumb Head 2 in Computers & Internet Programming & Design

3 answers

The VB6/Access 2000 codes are old ones based on DAO VB6 uses DAO or ADO objetcs to access data from Access 2000 tables.
Steps as per MSDN article referred are

* Create a connection to a Microsoft Access database file

Visual Studio 6 with VB6. You set DSN on the Windows system under the ODBC SQL source as a system DSN pointing the Path and d1.mdb to it. The ODBC Driver may be found for that support from MSDN in 2000.

* Create a data environment Command object
You can refer to the Command object in code as a method of the data environment, and refer to its recordset as a property of the data environment. For example, if you have created the EmpTable command in a data environment called "MyDataEnvironment," you can refer to the command in code as follows:

sub Onclick
{
MyDataEnvironment.EmpTable

end
}
* Create a simple data-bound form
In Create a Data Environment Command Object" topic to create a EmpTable command, simply drag the Command object from the Data Environment designer onto a blank form. To view both the form and data environment simultaneously so you can perform the drag operation, select Tile Horizontally, Tile Vertically, or Cascade from the Window menu.


For example, to create a Next button for the form that displays Emp records, add a command button to the form and change its Caption and Name properties to Next. Then add the following line to the command button's Next_Click event procedure:

sub OnNext_Click;
{
MyDataEnvironment.rsEmpTable.MoveNext

end
}
Calculate ...

Sub OnCalculate_Click,
{
rsEmpTable.Tax = rsEmpTable.BASIC * 0.30
}

Since this is an intercative Development environment uder VS 6.0, one has to try follow the MDSN guidelines and./or work and build an EXE file to release the same to other users as EXE files. (One can opt for DLL's like Static/Dynamic Unix/Linux libs too).

2007-04-13 20:30:39 · answer #1 · answered by pgp 2 · 0 0

Access 97 uses JET 3.51 while Access 2000 uses JET4.0
VB6 DAO won't work unless you have JET4.0 installed via MDAC(Microsoft Data Access Components). and VB6 SP6.

Depending on what MDAC versions you install will govern if Jet3.51 is installed. So if you uninstall MDAC and reinstall a later version you may loose Access 97 support as Jet3.51 is not reinstalled with jet4.0. The solution is to install an earlier version of MDAC which contains JET3.51 first then upgrade to a later version of MDAC.

2007-04-14 02:08:42 · answer #2 · answered by MarkG 7 · 0 0

get entry to is a reasonably ordinary application to apply, in terms of compliling a databse. There are wizards that may well be useful you build the database and run queries and reviews. Spend somewhat time interpreting it and it is going to manage to doing all you require.

2016-12-29 09:03:56 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers