Saturday, February 28, 2009

Make district program uses vb6 and sql server 2000

Lately many schools in indonesia that taught to hit base computers along with duties that vertiginous especially at database application computer area. under this we shall give tutorial to will make district program from regency and provinsi. for we give java scope. may this tutorial can help younger brothers that still at school to can equip the database application duties,  or may be also this program can be used for the things work or entrepreneur, because i make as easy as may be. 
 
Tools that must be need: 
1 computer package that can burn and functioned (monitor, cpu, keyboard, mouse) 
 

OS that used: 
Windows xp (supposed) (can at download torrent at windows xp sp3)
Other windows also allow that can installing vb and sql 
 
Software that used: 
Application sql server 2000 
Visual application basic 6.0 (can at download using torrent at vb6 enterprise edition)
Componentone true dbgrid 7.0 (can at download at  true dbgrid 7.0)
 
When all devices been prepared please read instruction next: 
 
My step: 
- Activate database that aimed at sql server 2000 (when still not yet has database do create database by click right" databases" be computer name exist in sql server 2000 then click new database (in example next use dbgeneral). see picture next: 
 
 
- After done data election (select database) or data maker create database). choose" sql query analyzer" at menu tools then press button to execute or query - execute. see picture next 
 
 
- Copy script under this use sql query analyzer. 
 
if exists (select name from master. dbo. sysdatabases where name = n'dbgeneral) 
deliver database [dbgeneral 
go 
 
create database [dbgeneral on (name = n'dbgeneral_data, filename = n'c: \program files\microsoft sql server\mssql\data\dbgeneral_data. mdf, size = 1, filegrowth = 10%) logarithm on (name = n'dbgeneral_log, filename = n'c: \program files\microsoft sql server\mssql\data\dbgeneral_log. ldf, size = 1, filegrowth = 10%) 
collate sql_latin1_general_cp1_ci_as 
go 
 
exec sp_dboption n'dbgeneral, n'autoclose, n'true 
go 
 
exec sp_dboption n'dbgeneral, n'bulkcopy, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'trunc. logarithm, n'true 
go 
 
exec sp_dboption n'dbgeneral, n'torn page detection, n'true 
go 
 
exec sp_dboption n'dbgeneral, n'read only, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'dbo use, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'single, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'autoshrink, n'true 
go 
 
exec sp_dboption n'dbgeneral, n'ansi null default, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'recursive triggers, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'ansi nulls, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'concat null yields null, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'cursor close on commit, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'default to local cursor, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'quoted identifier, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'ansi warnings, n'false 
go 
 
exec sp_dboption n'dbgeneral, n'auto create statistics, n'true 
go 
 
exec sp_dboption n'dbgeneral, n'auto update statistics, n'true 
go 
 
use [dbgeneral 
go 
 
if exists (select sysobjects where id = object_id(n'[dbo. [fk_tblkecamatan_tblkabupaten]) and objectproperty(id, n'isforeignkey) = 1) 
alter table [dbo. [tblkecamatan deliver constraint fk_tblkecamatan_tblkabupaten 
go 
 
if exists (select from dbo. sysobjects where id = object_id(n'[dbo. [fk_tblkabupaten_tblprovinsi]) and objectproperty(id, n'isforeignkey) = 1) 
alter table [dbo. [tblkabupaten deliver constraint fk_tblkabupaten_tblprovinsi 
go 
 
if exists (select from dbo. sysobjects where id = object_id(n'[dbo. [tblkabupaten]) and objectproperty(id, n'isusertable) = 1) 
deliver table [dbo. [tblkabupaten 
go 
 
if exists (select from dbo. sysobjects where id = object_id(n'[dbo. [tblkecamatan]) and objectproperty(id, n'isusertable) = 1) 
deliver table [dbo. [tblkecamatan 
go 
 
if exists (select from dbo. sysobjects where id = object_id(n'[dbo. [tblprovinsi]) and objectproperty(id, n'isusertable) = 1) 
deliver table [dbo. [tblprovinsi 
go 
 
create table [dbo. [tblkabupaten ( 
[code provinsi [varchar (10) collate sql_latin1_general_cp1_ci_as musical note null, 
regency [code [varchar (10) collate sql_latin1_general_cp1_ci_as musical note null, 
regency [name [varchar (25) collate sql_latin1_general_cp1_ci_as null, 
[username [varchar (30) collate sql_latin1_general_cp1_ci_as null, 
[date [datetime null 
) on [primary 
go 
 
create table [dbo. [tblkecamatan ( 
[code provinsi [varchar (10) collate sql_latin1_general_cp1_ci_as musical note null, 
regency [code [varchar (10) collate sql_latin1_general_cp1_ci_as musical note null, 
district [code [varchar (10) collate sql_latin1_general_cp1_ci_as musical note null, 
district [name [varchar (25) collate sql_latin1_general_cp1_ci_as null, 
[username [varchar (30) collate sql_latin1_general_cp1_ci_as null, 
[date [datetime null 
) on [primary 
go 
 
create table [dbo. [tblprovinsi ( 
[code provinsi [varchar (10) collate sql_latin1_general_cp1_ci_as musical note null, 
[name provinsi [varchar (25) collate sql_latin1_general_cp1_ci_as null, 
[username [varchar (30) collate sql_latin1_general_cp1_ci_as null, 
[date [datetime null 
) on [primary 
go 
 
alter table [dbo. [tblkabupaten with nocheck add 
constraint [pk_tblkabupaten primary key clustered 
[code provinsi, 
regency [code 
) on [primary 
go 
 
alter table [dbo. [tblkecamatan with nocheck add 
constraint [pk_tblkecamatan primary key clustered 
[code provinsi, 
regency [code, 
district [code 
) on [primary 
go 
 
alter table [dbo. [tblprovinsi with nocheck add 
constraint [pk_tblprovinsi primary key clustered 
[code provinsi 
) on [primary 
go 
 
alter table [dbo. [tblkabupaten with nocheck add 
constraint [df_tblkabupaten_nama default regency (' ') for regency [name, 
constraint [df_tblkabupaten_username default ('renceman) for [username, 
constraint [df_tblkabupaten_tanggal default (getdate() for [date 
go 
 
alter table [dbo. [tblkecamatan with nocheck add 
constraint [df_tblkecamatan_nama default district (' ') for district [name, 
constraint [df_tblkecamatan_username default ('renceman) for [username, 
constraint [df_tblkecamatan_tanggal default (getdate() for [date 
go 
 
alter table [dbo. [tblprovinsi with nocheck add 
constraint [df_tblprovinsi_nama provinsi default (' ') for [name provinsi, 
constraint [df_tblprovinsi_username default ('renceman) for [username, 
constraint [df_tblprovinsi_tanggal default (getdate() for [date 
go 
 
alter table [dbo. [tblkabupaten add 
constraint [fk_tblkabupaten_tblprovinsi foreign key 
[code provinsi 
) references [dbo. [tblprovinsi ( 
[code provinsi 
) on update cascade 
go 
 
alter table [dbo. [tblkecamatan add 
constraint [fk_tblkecamatan_tblkabupaten foreign key 
[code provinsi, 
regency [code 
) references [dbo. [tblkabupaten ( 
[code provinsi, 
regency [code 
) on update cascade 
go 
 
Explanation: 
To dbgeneral can at change by find replace as according to database name that at will go, the example at this site uses database dbgeneral. see be picture: 
 
 
 
For database maker finished. 
 
step ii: 
- Program maker clicks program maker uses vb6

0 comments:

Angel Save Knight Man in 1995 - Linux, Blogger, Marketing, Business, Internet | Template by - Abdul Munir - 2008