Registration and Login scripts using VB and Oledbconnection to Access Database

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Nov 2005
Posts: 1
Reputation: rayferns is an unknown quantity at this point 
Solved Threads: 0
rayferns rayferns is offline Offline
Newbie Poster

Registration and Login scripts using VB and Oledbconnection to Access Database

 
0
  #1
Nov 19th, 2005
Hello all Programmers,

I am preparing a website with login credentials to a welcome site.

I need help in the following:

1) create a registeration page where by the user enters their username, password and email address

2) once the user submits the details, records are inserted into users database - use of OleDbconnection to Access database, with no sql parameters.

3) Once the details are entered, the user can enter login page and enter their Email address and password. These details should exist within the access database. If the user enterr the right details, a welcome message is displayed with the Welcome <username> message

Requirements: Design in Webmatrix, language - VB, Database connection - OleDB, Datareader, validation not required for now.

With this script I need to check whether insert works having a reserved word "password" as a field name in a table.

I am a beginner to ASP.NET, so far I have written this:

  1. <script runat="server">
  2.  
  3. Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  4.  
  5. Dim usernm as String = username.text.Trim()
  6. Dim passwrd as String = passwd.text.Trim()
  7. Dim emailId as String = email.text.Trim()
  8.  
  9. AddNewUser(usernm, passwrd, emailId)
  10.  
  11. Response.Redirect("login.aspx")
  12.  
  13. End If
  14.  
  15. End sub

  1. sub reset()
  2.  
  3. username.text = ""
  4. password.text = ""
  5. email.text = ""
  6.  
  7. end sub

  1. sub AddNewUser(ByVal strUser As String, ByVal strPass As String, ByVal strEmail As String, ByVal strPass As String)
  2.  
  3.  
  4. Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;"
  5. strConnection += "Data Source=C:\Inetpub\wwwroot\myDB.mdb"
  6.  
  7.  
  8. Dim objConnection as New OledbConnection(strConnection) '
  9.  
  10. Dim InsertCmd as String = "INSERT INTO passwords (name, email, [password],) values('" & _
  11. strUser & "','" & _
  12. strPass & "','" & _
  13. strEmail & "')"
  14.  
  15.  
  16. Dim Mycommand = New OleDbCommand(InsertCmd, objConnection)
  17.  
  18. MyCommand.Connection.Open()
  19.  
  20.  
  21. Try
  22. objConnection.Open()
  23. MyCommand.ExecuteNonQuery()
  24.  
  25. objConnection.Close()
  26.  
  27. Catch ex As Exception
  28. Message.Text = "Error Connecting to Database!"
  29. End Try
  30.  
  31. End Sub
  32.  
  33. </script>
  34.  

After compiling this piece of code in WebMatrix, I get this error message " ----> BC30455: Argument not specified for parameter 'strPass' of 'Public Sub AddNewUser(strUser As String, strPass As String, strEmail As String, strPass As String)'. <----"
for Line 12: AddNewUser(usernm, passwrd, emailId), Any ideas why?




I would appreciate any help or suggestions on how to achieve this.

Thanks in advance.
Last edited by Paladine; Nov 20th, 2005 at 1:03 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 27
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Registration and Login scripts using VB and Oledbconnection to Access Database

 
0
  #2
Nov 20th, 2005
Hi there rayfrens;

I can tell you why you are getting this error. You are passing only 3 arguments to a 4 argument subroutine. You have declared strPass twice in the AddNewUser Subroutine

Public Sub AddNewUser(strUser As String, strPass As String, strEmail As String, strPass As String)

Hope this helps
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC