Skip to main content

Database Application


this is just a simple database query developed during my lunch break =) hope u like it =)

Tags

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

I have reviewed your code. It's nice but there is a problem with interacting COM objects with .NET objects. In your example, you interopped Microsoft ActiveX DataObjects with your .NET application. Microsoft ActiveX Data Object is a COM library. As we all know, much of the previous COM implementations (VB6, VC++6 etc) had been replaced or updated when .NET was introduced. So instead of creating an ADODB.Recordset object for Inserting new records, you can just use OleDbCommand to the the record insertion. Example: Using cmd as New OleDbCommand cmd.Connection = conn cmd.CommandText = "Insert into table SET column [email protected]" cmd.Parameters.Add("@value", OleDbType.Varchar).Value = value cmd.ExecuteNonQuery() End Using Also using OleDbCommand parameters reduce SQL injection attacks, which makes your application safer. Although COM and .NET interop is possible, for optimization, if it is possible in .NET, do it in .NET.

i agreed with you bro.. we can use dis instead of adodb.recordset. for me, i prefer, odbcconnection than oledbconnection for example.. import system.data.odbc Dim myconnection = New System.Data.Odbc.OdbcConnection("dsn=SampleDatabase") dim myRecordset as new odbcConnection with myRecordset .connection=myconnection .commandText="Insert into tblname(Fname)values(''"& txtFname.text &"') .executeNonQuery() End with thats it!So simple..No need of any adds-on References.hehe GodBless

actually ur both correct guys.. where in vb.net so well gonna use ADO.net ill just post this code because some user ask me ho to use ADO (ADODB.recordset) in inserting records.. so this was just a help =) hehehe soon ill post my latest project =) Quiz Bee system
Submitted byAnonymous (not verified)on Thu, 12/31/2009 - 16:41

i agreed with sir arjay.. Happy new year
Submitted byAnonymous (not verified)on Mon, 01/04/2010 - 13:16

woe tnx sir for the comment =) but i prefared using recordset in inserting records but anyways this is just an example of my work. Yes, thanks for the info that OleDbCommand parameters reduce SQL injection attacks. Im just new hir so I need your help in programming =)
Submitted bycharle2364on Wed, 01/13/2010 - 12:19

sir cedrick, i kinda like your post, it fits on my current project.. i am new in VB.net and still studying it. i quoted the code here: rs = New ADODB.Recordset rs.Open("Select * from administrator", cnstring, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) rs.AddNew() rs("username").Value = txtusername.Text rs("password").Value = txtpassword.Text rs.Update() MsgBox("Save!", MsgBoxStyle.Information, "Save") txtpassword.Text = "" txtusername.Text = "" gridview1.Refresh() i just want to ask what is the meaning of this line: rs = New ADODB.Recordset rs.Open("Select * from administrator", cnstring, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) thanks alot!
Submitted byAnonymous (not verified)on Wed, 01/13/2010 - 13:13

In reply to by charle2364

i just transferd mah code in vb 6 to .net but anyways... in this line rs = New ADODB.Recordset rs.Open("Select * from administrator", cnstring, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) the recordset open and select what table(administrator table) to be used =)
Submitted byAnonymous (not verified)on Tue, 02/02/2010 - 11:01

can u please teach me how to work with ado in my program??/
Submitted bycedon Fri, 02/05/2010 - 10:58

In reply to by Anonymous (not verified)

activex design object :) sa VB ba? kasi pwede rin ADO sa .net

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.