Jump to content

VB 2005 express edition please help code problem

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dusty

dusty

    Newbie

  • Members
  • Pip
  • 2 posts
hello everyone i'm having trouble with my coding

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 :D

I'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


#2
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Please another time make your post according to these rules:

http://forum.codecal...p-properly.html

#3
dusty

dusty

    Newbie

  • Members
  • Pip
  • 2 posts
Edit