This piece of code below is supposed to save the data entered by the user from two text boxes and store the information in a database in the destined location the program builds absolutely fine with no errors however it doesn't seem to save the information into the database as expected
heres the code...
Private Sub btnFin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFin.Click
Dim NUPS As String = txtNewId.Text
Dim NUID As String = txtNewPass.Text
Dim con As New OleDb.OleDbConnection
con.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = C:\Computing Coursework\Store.mdb"
con.Open()
Dim da As OleDb.OleDbDataAdapter
Dim strSQL As String
strSQL = "INSERT INTO tblUser (UserId,Password) VALUES ('" & NUID & "','" & NUPS & "')"
'i believe this part is supposed to cause the information from the textboxes to be entered into the database
da = New OleDb.OleDbDataAdapter(strSQL, con)
end sub
now whenever i enter data into the text boxes set as NUID & NUPS it just continues and doesn't store the data into my database can anyone help at all i am extremely new any help with be extremely appreciated :DI'm currently using visualb basic 2005 express edition for my project with windows Xp and my database is an mdb file made using Access 2003,
Also another query, how would i compare a fixed date to the current date returning a value which is the number of days difference there is between them?
again many thanks
Edited by dusty, 04 April 2008 - 09:23 AM.
to comply with help section


Sign In
Create Account

Back to top









