You are on page 1of 9

Database Connectivity This tutorial shall show you how to connect to a Microsoft Access Database using Microsofts ActiveX

Data Object. This is a DSN-less connection that will only a!e use of a connection object to e"ecute S#$ State ents to the %atabase. This eans that you nee% to learn S#$ to be able to issue the &ro&er co an%s. 'efore we &rogra however( there are a few things about the configuration of the syste files that nee%s to be e"&laine% for all of these co%es to wor!. )e e ber that this will NOT work without the )eference to Microsoft ActiveX Data Objects library *this particular project used 2.5+ 1. The application path and File locations ,or the %atabase connectivity to wor!( -isual 'asic nee%s to !now where the Database file is. So the connection string of the connection object usually has the &ath to the %atabase file. The &roble lies in the fact that if we %eci%e to transfer this file to another location( the &ath wont wor! any ore hence( the connection fails. .eres the solution/ put the Database file in the same folder as the Application/Project File and use a RELAT !E PAT" to the database file. 0n our 1"a &le( heres how the syste Sample folder s contents &rjMyStu%entMaintenance.vbp &rjMyStu%entMaintenance.vbw MSS442)5.SCC fr A%%.fr! fr Delete.fr! fr 1%it.fr! Db %bStu%ents.mdb MS-Access Database ,ile ove the whole Sa &le fol%er an% files loo! li!e/ The whole syste in locate% in a fol%er na e% Sa &le.

-isual 'asic 2roject ,ile -isual basic 3or!s&ace ,ile -isual 'asic Source 4o%e ,ile -isual 'asic ,or -isual 'asic ,or ,ile ,ile

-isual 'asic ,or ,ile Directory 6 ,ol%er

This way( if we %eci%e to ove the &roject to another location( we si &ly not worry about anything about the co%e.

". The Database Structure The Database is %bStu%ents. %b( it also has only one table insi%e na e% tblStu%ents which loo!s li!e this/ The Design of tblStu%ents/

The Datasheet -iew of the table loo!s li!e this/

Note that the fl%Stu%entNa e has this for at/ LA#T$A%E , F R#T $A%E ,% DDLE $A%E #. S$% &riefin' S#$ caters a lot of %ifferent %ata ty&es an% basically( we are %ealing with three %ifferent %ata ty&es here/ Te"t6String( Nu ber60nteger an% Date6Ti e. As a re in%er( heres how the values &asse% to the %atabase through S#$ shoul% loo! li!e. Data Type (assin' )alue Te"t *My Te"t Nu ber Date6Ti e 789

+79:77:;99<+

,ddin' -ecords to the Database .eres the full tutorial of how 0 a%% recor%s to a %atabase. 0ve &ut so e co%e that 0 will e"&lain as we go through the &rocess. $ets loo! at the for = *loo&s innocent doesn't it( Frea&) little creep* a monster form it is tell )ou++. 0ve &ut na es only to significant controls an% left the others to their %efaults.

t!tStud0D6 this te!tbo! is locked t!tStudFN

t!tStud4N t!tStud%N

cmd,dd

cmd5enerate0D
The for has the following flow. 1. The user creates an 0D by clic!ing on the >enerate 0D 'utton. ". The user in&uts his or her ,irst Na e( Mi%%le Na e an% $ast Na es #. The user clic!s the A%% 'utton 3ith that all set( lets &ry into the co%e/ ,irst( lets ta!e a loo! at how the &rogra generates a new 0D Nu ber. This has a lot to %o with how the 0D Nu ber loo!s li!e. The Ty&ical 0D $oo!s li!e this/ ;99<9997 *where ;99< &robably is the %ate an% the nu bers succee%ing it refer to the or%er in which the user obtaine% the nu ber+ .eres the co%e/
Private Sub cmdGenerateID_Click() ?4onnect to the Database an% have a )ecor%set Object Dim Connec As New ADODB Connection! "s As New ADODB "ecordset ?3e use the A&&.&ath to access the &rojects &ath an% a%% in the %b fol%er an% the filena e of our %atabase Connec O#en $Provider%&icroso't (et O)*DB + ,-Data Source %$ . A## Pat/ . $0db0dbStudents mdb$ ?Select all stu%ent recor%s fro the table with fl%Stu%ent0Ds that start with the 4urrent @ear an% &ut ?the recor%set. 0 got the in %escen%ing or%er ?This is how the S#$ State ent shoul% loo! li!e/ ....Select / from tblStudents where fldStudent0D like *"1123 order by fldStudent0D desc... in the

Set "s % Connec *1ecute($Select 2 'rom tblStudents w/ere 'ldStudentID like 3$ . 4ormat(Date! $5555$) . $63 order b7 'ldStudentID desc$) ?0f we cant fin% a stu%ent that has such a stu%ent nu ber( then this current stu%ent ight be the first ?one to enroll this year. 3e will give hi 6her the first stu%ent nu ber/ ;99<9997 I' "s BO4 % 8rue 8/en &e t1tStudID 8e1t % 4ormat(Date! $5555$) . $,,,9$: *1it Sub ?0f we %o fin% a stu%ent with a si ilar 0D nu ber( then we get the last 0D nu ber an% a%% 7 to that( ?we for at the su into four %igits an% that beco es our stu%ent nu ber &e t1tStudID 8e1t % 4ormat(Int("s($'ldStudentID$)) ; 9! $<<<<$) ?having %one what we ca e for( we close our connections an% en% the &rogra "s Close Connec Close *nd Sub

4akin' sure that the user inputs the correct format

The user ay not !now how to use syste s li!e this( or the user aybe a naughty little git that we a!e sure that he6she in&uts the correct for at of %ata in the te"tbo"es.

ay have to

,or such instances( 0 choose to correct the wrongs in the users in&ut. 0 a!e sure that for na es( the &rogra observes &ro&er ca&italiAation of na es to a!e the na es ore &resentable in the %atabase. To %o this( 0 create a function that &ro&erly ca&italiAes all things thats &ut into it.

*This function returns a Strin' )alue named (roper *This function requires a Strin' )alue named Str Function Proper(Str As String) As String *the function 'ets the first leftmost character in Str ...........................%eft7Str819 *ne!t the function 'ets the capital letter of that character ....................:Case7%eft7Str8199 *ne!t the function 'ets the %en'th of Str ........................................%en7Str9 *the function uses this len'th to 'et the middle of the strin' from the second character to the last *.......................................................................................4id7Str8"8%en7Str99 *if for e!ample the strin' is *'Osh;n *the len'th would be < *the middle of the strin' from the second character to the si!th would be *Osh;n *the function then 'ets the lowercase of this strin' ...........................%Case74id7Str8"8%en7Str999 *the function concatenates the capitali=ed First letter to the rest of the strin' *the function trims the finished product8 deletin' the e!tra spaces before and after the letters *......................................................................................Trim7 9 *the function returns the value and puts it into (roper... the variable *and there you have it> it s a one liner code that does a lot of thin's Proper = Trim(UCase(Left(Str, 1)) & LCase(Mid(Str, !nd Function , Len(Str))))

Ne"t( what 0 %i% is call the co%e in all of

y Na e te"tbo"es.

Pri"ate Su# t$tStudF%&'e(Press('e(Ascii As )nteger) *?hen the user presses the ;NT;- @;A with a @ey,scii of 1#8 its time to put thin's into (roper )f 'e(Ascii = 1* T+en *the contents of the te!tbo! is confiscated and replaced by it (roper counterpart t$tStudF%,Te$t = Proper(t$tStudF%,Te$t) *0f the user already pressed the ;NT;- @;A8 that means that he must be finished with the firstname and *may probably is ready to 'o on to the middle name. Me,t$tStudM%,SetFocus !nd )f !nd Su#

B5ust %o this for all te"t bo"es an% youve a%e sure that every na e co es out right. B,ne thin- left to do here. 0f the user in&uts a co &oun% na e li!e Ma. Ma!iling or so ething( the current &rogra %oesnt su&&ort &utting the secon% na e into its &ro&er for at= * m thin&in- )ou could do that for )our Finals hehehe++ A clue= Do loo&= an% loo! for s&aces using instring function.

,ddin' a -ecord to a Database Table :sin' an S$% Command and an ,DO Connection ObBect 7Lipad po an- ta/a- 0don9

3ell( actually NO'OD@ %oes this. Only a han%ful of &eo&le coul% &ull off a%%ing recor%s to a %atabase table using only one ADO Object--- the connection object. Now you !now the $egen% of the flying S#$ State ent.
Pri"ate Su# cmdAdd&C-ic.() *?e check if there are te!tbo!es that are left with no values *we use the len'th of the strin'> if the len'th is 1 then8 the te!tbo! is empty *if the te!tbo! is empty8 we issue appropriate error messa'es and then Cuit )f Len(Me,t$tStudF%,Te$t) = / T+en Msg0o$ 1P-ease input (our First %ame,1, , 1Add Student12 !$it Su# )f Len(Me,t$tStud)3,Te$t) = / T+en Msg0o$ 1P-ease c-ic. t+e 4enerate )3 0utton to create (our Student )3 %um#er,1, , 1Add Student12 !$it Su# )f Len(Me,t$tStudL%,Te$t) = / T+en Msg0o$ 1P-ease input (our Last %ame1, , 1Add Student12 !$it Su# )f Len(Me,t$tStudM%,Te$t) = / T+en Msg0o$ 1P-ease input (our Midd-e %ame1, , 1Add Student12 !$it Su# *?e connect to the database 3im Connec As %e5 A3630,Connection, 7s As %e5 A3630,7ecordset Connec,6pen 1Pro"ider=Microsoft,8et,6L!30,9,/:3ata Source =1 & App,Pat+ & 1;d#;d#Students,md#1 *?e use the -ecordset to search the database for a student with a similar Student Name *the code in the parentheses yields this S$% *....Select fldStudent0D from tblStudents where fldStudentName D *%astName FirstName 4iddleName Set 7s = Connec,!$ecute(1Se-ect f-dStudent)3 from t#-Students 5+ere f-dStudent%ame = <1 & Me,t$tStudL%,Te$t & 1,1 & Me,t$tStudF%,Te$t & 1,1 & Me,t$tStudM%,Te$t & 1<1) *0f we do find a student with e!actly the same name8 then8 this must be a duplicate entry *we tell the user of the mistake8 close the recordset and Cuit )f 7s,06F = Fa-se T+en Msg0o$ 13up-icate !ntr(1, , 1Add Student12 7s,C-ose2 !$it Su# *0f we don t need the recordset8 let s close it to reduce dependencies 7s,C-ose *Now we perform the actual data ,dd *?e use the e!ecute method to throw the S$% statement to the database ... 0N your F,C;E (unkE *The S$% formed between the parentheses looks like this *0nsert into tblStudents 7fldStudent0D8fldStudentName8fld;nrollDate9 values 7 "11211118 D *%astName FirstName 4iddleName 8 +11F11F"112+ 9 The ..8 8 ad;!ecuteNo-ecords .... let ,DO know that it is not 'oin' to retrieve records from the database Connec,!$ecute 1)nsert )nto t#-Students (f-dStudent)3,f-dStudent%ame,f-d!nro--3ate) "a-ues (1 & )nt(Me,t$tStud)3,Te$t) & 1,<1 & Me,t$tStudL%,Te$t & 1 1 & Me,t$tStudF%,Te$t & 1,1 & Me,t$tStudM%,Te$t & 1<,=1 & 3ate & 1=)1, , ad!$ecute%o7ecords Gavin' done that8 we close the connection Connec,C-ose ,nd tell the user we had 'ood hits Msg0o$ 1Add successfu-1 !nd Su#

This is basically your non-basic ADO 4onnection=

;ditin' -ecords in the Database This tutorial is about e%iting a recor% fro the %atabase. )e e ber the Ste&s to 1%iting the )ecor%= 1. $et the user &ic! the recor% to be e%ite%.

". Show the recor% he &ic!e% on the screen. #. Dont let hi e%it the recor% unless he &resses the 1%it 'utton( this is a stan%ar% o&erating &roce%ure. 0f a user who chooses a wrong recor% ista!ably &resses !eyboar% !eys( then( the %ata on the screen will be altere% an% it will be a total ess. To avoi% this( let the user Csay &leaseD so to s&ea!. H. $et the user e%it the recor%= on his ownE but correct the ista!es he co its. 2. 0f all goes well at this &oint( let the user save the changes by clic!ing the Save button. .eres the for /

t!tStud0D6 this te!tbo! is locked cboFullnames t!tStudFN6 this te!tbo! is locked

t!tStud4N6 this te!tbo! is locked t!tStud%N6 this te!tbo! is locked

cmd;dit

cmdSave6 this button is disabled


,irstly( we nee% to give the user so e choices= after all( the user has to &ic! a recor% u& rightF So 0 thought of &utting the co bo bo" there to &rovi%e the user so e way of &ic!ing which stu%ent recor% to e%it. So how %o we get the recor%s fro a %atabase table into a co bo bo"F... an% 3henF A goo% i%ea is to %o whatever we want to %o %uring the ,or $oa% event. The ,or $oa% event ha&&ens before we see the for on the screen *it's a bac&sta-e preparation pal++ (opulatin' a lonely Combo bo! with records from a database table durin' Form %oad
Pri"ate Su# Form&Load() *5et the connection set up 3im Connec As %e5 A3630,Connection, 7s As %e5 A3630,7ecordset Connec,6pen 1Pro"ider=Microsoft,8et,6L!30,9,/:3ata Source =1 & App,Pat+ & 1;d#;d#Students,md#1 *Collect the data with the use of your -ecordset 7in this case we 'et all the StudentNames9 Set 7s = Connec,!$ecute(1Se-ect f-dStudent%ame from t#-Students1) *This is an error trapper in case the recordset comes back empty8 we simply close the record set and Cuit )f 7s,06F = True T+en 7s,C-ose2 !$it Su# *make sure to start from the be'innin' of the list 7s,Mo"eFirst *5o over each record in the recordset by sayin' *do this till the ;nd Of File 3o >+i-e %ot 7s,!6F *,dd the content of the recordset to the combo bo! Me,c#oFu--%ames,Add)tem 7s(1f-dStudent%ame1) *Skip to the ne!t record 7s,Mo"e%e$t Loop *Don t for'et to close the recordset and the connection obBect afterwards 7s,C-ose Connec,C-ose !nd Su#

Displayin' the -ecord on the Screen

3hen the user has a%e u& his in% an% &ic!e% a recor% fro our list( we the screen. 3e use the 4o bo 'o"s on4lic! event to %o this.
Pri"ate Su# c#oFu--%ames&C-ic.() *19 Fetch the student s 0D number from the database *Crank up the connection 3im Connec As %e5 A3630,Connection, 7s As %e5 A3630,7ecordset

ust %is&lay the sai% recor% onto

Connec,6pen 1Pro"ider=Microsoft,8et,6L!30,9,/:3ata Source =1 & App,Pat+ & 1;d#;d#Students,md#1 *here we collect the 0D number from the database table the S$% looks like this *....Select fldStudent0D from tblStudents where fldStudentName D *%astName FirstName 4iddleName Set 7s = Connec,!$ecute(1Se-ect f-dStudent)3 from t#-Students 5+ere f-dStudent%ame = <1 & Me,c#oFu--%ames,Te$t & 1<1) *for once we are certain that we will 'et arecord from the database> why because the information we *used to 'et the data also came from the databaseE *all we have to do now is to put the 0D on the te!tbo! Me,t$tStud)3,Te$t = 7s(1f-dStudent)31) *we don t need the recordset any more so close this to'ether with the connection obBect 7s,C-ose Connec,C-ose *Now we have to show the First Name8 4iddle Name and the %ast Names separately on different tectbo! *even thou'h it came from Bust one record *.im declarin' a variable 0 ll be needin' later> this is improper but heyE 0t worksE 3im Spare As String *First off8 we 'et the last name8 since this is the easiest to 'et. *Since the name is separated by commas8 we locate the first comma .... 0nstr7me.cboFullNames.Te!t9 *then we 'et the leftmost substrin' of the lot until the first comma minus 1> *minus 1 because we don t want to include the comma itself. ?e only want the letters to the left of it *we Trim the whole thin' to 'et the e!tra spaces out Me,t$tStudL%,Te$t = Left(Me,c#oFu--%ames,Te$t, )nStr(Me,c#oFu--%ames,Te$t, 1,1) ? 1) *0 now use my Spare strin'> first8 0 'et the middle of the whole strin' from the ri'ht of the first comma *to the last one> we determine the character number of the last letter by askin' how lon' the strin' is. *...........%en74e.cboFullNames.Te!t9 *0 also *So now the Spare contains this6 FirstName 4iddleName Spare = Trim(Mid(Me,c#oFu--%ames,Te$t, )nStr(Me,c#oFu--%ames,Te$t, 1,1) @ 1, Len(Me,c#oFu--%ames,Te$t))) *0 use the same techniCue 0 did with the last name to fetch the First Name from the Spare *trim it and you re done Me,t$tStudF%,Te$t = Trim(Mid(Spare, 1, )nStr(Spare, 1,1) ? 1)) *0 look for the comma in the spare and sice there is only one comma8 0 'et the characters that come from *the ri'ht of that to the end of the strin' and poofE 0 now have the 4iddle nameE *don t for'et the trim 'uys Me,t$tStudM%,Te$t = Trim(Mid(Spare, )nStr(Spare, 1,1) @ 1, Len(Spare))) !nd Su#

,pplyin' %ocks

0ve sai% earlier that its i &ro&er to let the user just e%it the recor% after %is&laying it. Now( 0 teach you how to loc! an% unloc! te"tbo"es with the use of just one button *not T/o+

0n a sense( its not actually the 1%it 'utton that e%its the recor%s fro the %atabase its the Save 'utton. The 1%it 'utton is just there for unloc!ing the te"tbo"es=so=yeah the user %oesnt !now about that= but who caresF .eres how to turn that 1%it 'utton into a loc! an% Gnloc! button for the te"tbo"es.
Pri"ate Su# cmd!dit&C-ic.() *?e make the button perform dual tasks by applyin' modes to it *0f the &utton is in ;dit mode8 then we unlock the te!tbo!es *,nd when it is in &ack mode8 we lock then up )f cmd!dit,Caption = 1!dit1 T+en *The button is in ;dit mode so we unlock the te!tbo!es e!cludin' the Student 0D *this is because Student 0Ds are primary keys and primary keys aren t supposed to be edited. Me,t$tStudF%,Loc.ed = Fa-se Me,t$tStudL%,Loc.ed = Fa-se Me,t$tStudM%,Loc.ed = Fa-se *0f the user edits the record8 then we should allow him to save the chan'es cmdSa"e,!na#-ed = True *Chan'e the mode of the &utton to &ack 4ode cmd!dit,Caption = 10ac.1 !-se *The button is in &ack 4ode so let s 'o back to the ori'inal Setup. *%ock the te!tbo!es as they were from the start Me,t$tStudF%,Loc.ed = True Me,t$tStudL%,Loc.ed = True Me,t$tStudM%,Loc.ed = True *Disable the Save button cmdSa"e,!na#-ed = Fa-se *,nd chan'e to ;dit 4ode cmd!dit,Caption = 1!dit1 !nd )f !nd Su#

This is only a few of the any won%erful things we can %o with 0, Then 1$S1 State ent= youll get to !now all of those other won%erful things when you are out there trying to thin!s of ways to a!e your future &rogra wor!. 3ith that set( 0 woul% li!e to &oint out that the e%iting &rocess also nee%s the sa e treat ent as the A%%ing of )ecor%s. So 0 also i &ose y 2ro&er ,unction an% the Hey2ress etho%s on the te"t bo"es. 5ust see the 4akin' sure that the user inputs the correct format tutorial.

Savin' the Chan'es ... the ,ctual ;ditin'

'y virtue( it is not the 1%it 'utton that e%its the recor%= it is the Save 'utton. So now( we woul% &erfor actual e%iting of recor%s in the Save button. The co%e is as follows/
Pri"ate Su# cmdSa"e&C-ic.()

the

*,s usual8 we check the te!tbo!es if they are left with nothin'> the same code e!cept that 0 ve chan'ed *the title of the error messa'es to ;dit Student )f Len(Me,t$tStudF%,Te$t) = / T+en Msg0o$ 1P-ease input (our First %ame,1, , 1!dit Student12 !$it Su# )f Len(Me,t$tStudL%,Te$t) = / T+en Msg0o$ 1P-ease input (our Last %ame1, , 1!dit Student12 !$it Su# )f Len(Me,t$tStudM%,Te$t) = / T+en Msg0o$ 1P-ease input (our Midd-e %ame1, , 1!dit Student12 !$it Su# *Connect to the database 3im Connec As %e5 A3630,Connection, 7s As %e5 A3630,7ecordset Connec,6pen 1Pro"ider=Microsoft,8et,6L!30,9,/:3ata Source =1 & App,Pat+ & 1;d#;d#Students,md#1 *Gere8 we check for duplicate entries *0 m checkin' for student with the same student name but has another student number *the S$% looks like this *Select fldStudent0D from tblStudents where Not7fldStudent0D D Idnumber9 and fldStudentName D *%astName FirstName 4iddleName Set 7s = Connec,!$ecute(1Se-ect f-dStudent)3 from t#-Students 5+ere %ot(f-dStudent)3= 1 & )nt(t$tStud)3,Te$t) & 1) and f-dStudent%ame = <1 & Me,t$tStudL%,Te$t & 1,1 & Me,t$tStudF%,Te$t & 1,1 & Me,t$tStudM%,Te$t & 1<1) *0f the recordset is not empty8 we have a problem8 the student tried to chan'e his name into the name of *his classmate ... we certainly cannot allow that *?e tell him off and Cuit )f 7s,06F = Fa-se T+en Msg0o$ 13up-icate !ntr(1, , 1!dit Student12 7s,C-ose2 !$it Su# *N;);- for'et to close the record set if you don t need it anymore 7s,C-ose *Gere s the fun part8 0f all 'oes well with the user8 we Bust edit the record by throwin' an :pdate S$% *Statement to the database *The same %0(,D 0 told you about in the ,dd Student *the S$% Statement looks like this *:pdate tblStudents Set fldStudentName D *%astName FirstName 4iddleName where fldStudent0D D Idnumber Connec,!$ecute 1Update t#-Students Set f-dStudent%ame = <1 & Me,t$tStudL%,Te$t & 1,1 & Me,t$tStudF%,Te$t & 1,1 & Me,t$tStudM%,Te$t & 1< 5+ere f-dStudent)3 = 1 & )nt(Me,t$tStud)3,Te$t) *Close the connection Connec,C-ose *Tell the user it is a success Msg0o$ 1!dit successfu-1 !nd Su#

Deletin' -ecords from a Database An% here we are at the last tutorialE we are now going to %elete a recor% fro a %atabase table. )e e ber that %eleting is a %elicate &rocess because once we %elete a recor%E we si &ly cannot &ut it bac!.

3ith this in in%( 0 have %evise% the following for &roce%ure or flow/ 1. The user searches for the recor% to be %elete%. ". The &rogra %is&lays the %etails on the screen an% the Delete button is enable%. #. The &rogra as!s the user to confir the %elete. H. The &rogra %eletes the recor%.

t!tStud0D6 this te!tbo! is locked cboFullnames t!tStudFN6 this te!tbo! is locked

t!tStud4N6 this te!tbo! is locked t!tStud%N6 this te!tbo! is locked

cmdDelete6 this button is disabled


Now lets see how 0 %i% this( first( 0 %evise a &lan of a!ing the user feel co fortable when &ic!ing u& the recor% to %elete. This is uch li!e the recor% &ic!er in the 1%it ,or . ,or this &art( just see the (opulatin' a lonely combo bo! with records from a database an% the Displayin' the record on the Screen tutorials. 1nough of that lets ju & to the %eleting the recor% alrea%y. 3hen the user has alrea%y &ic!e% a recor% an% %eci%es to %elete the recor%( we have the following co%e.
Private Sub cmdDelete_Click() ?This essage bo" %oes a lot= because it gets values --- vb@es or vbNo ?This co%e %is&lays a essage bo" that as!s the user if he really wants to %elete the recor%. ?The essage bo" offers hi two choices( @es an% No ?0f he &ic!s @es( the essage bo" has a value of vb@es an% vbNo if otherwise ?Now we as! if the essage bo" what value it has= an% if has a value of vb@es( if it is( then we &rocee%= I' &s=Bo1($Do 7ou reall7 want to delete t/is record>$! vb5esNo! $Delete Student$) % vb5es 8/en ?3e &rocee% by connecting to the %atabase Dim Connec As New ADODB Connection Connec O#en $Provider%&icroso't (et O)*DB + ,-Data Source %$ . A## Pat/ . $0db0dbStudents mdb$ ?Now we throw an S#$ state ent that %eletes the recor% fro the table ?heres the sa &le S#$ ?Delete fro tblStu%ents where fl%Stu%ent0D I D$umber Connec *1ecute $Delete 'rom tblStudents w/ere 'ldStudentID % $ . Int(&e t1tStudID 8e1t) ?3e close the connection an% tell the user that the %elete went fine Connec Close &s=Bo1 $Delete Success'ul $! ! $Delete Student$ *nd I' *nd Sub

Thats all there is to it. )e e ber that Security is always an issue in &rogra %o( 2)OT14T @OG) DATAJ

ing syste s so whatever you

So guys( that wra&s u& the Database 4onnectivity Tutorial= see you on the ne"t flightJ

You might also like