943,522 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 798
  • VB.NET RSS
Feb 6th, 2009
0

login form

Expand Post »
Pls. tell me what's wrong with this code, I really need a big help.....
tnx in advance...

VB.NET Syntax (Toggle Plain Text)
  1. Imports System.Data.OleDb
  2.  
  3. Module Module1
  4.  
  5. Public admin As Boolean 'Use to identify if current user is Administrator
  6.  
  7. End Module
  8.  
  9.  
  10. Public Class LoginForm1
  11.  
  12.  
  13. Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
  14. Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\Documents and Settings\Administrator\Desktop\login\login\salesReportDataSet.xsd")
  15.  
  16.  
  17.  
  18.  
  19. Dim cmd As OleDbCommand = New OleDbCommand("SELECT Username FROM salesReportDataSet WHERE Login = '" & Username.Text & "' AND Password = '" & Password.Text & "' ", cn)
  20.  
  21. cn.Open()
  22. Dim dr As OleDbDataReader = cmd.ExecuteReader()
  23. If (dr.Read() = True) Then
  24. Form1.Show()
  25.  
  26.  
  27. MsgBox("Login Successful, " & Username.Text & "!")
  28. Else
  29.  
  30. MsgBox("Invalid login")
  31. End If
  32. 'Else
  33.  
  34. cn.Close()
  35.  
  36.  
  37. End Sub
  38.  
  39.  
  40.  
  41. Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
  42. Me.Close()
  43. End Sub
  44.  
  45.  
  46. Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  47.  
  48.  
  49.  
  50. End Sub
  51. End Class
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
lerkei is offline Offline
36 posts
since Jan 2008
Feb 6th, 2009
0

Re: login form

Can you tell us what happens before we have to puzzle?

(think about getting your car back to the shop & ask the technician if he can tell you what's wrong with your car?)
Last edited by 4advanced; Feb 6th, 2009 at 4:28 am.
Reputation Points: 33
Solved Threads: 10
Junior Poster in Training
4advanced is offline Offline
67 posts
since Nov 2008
Feb 6th, 2009
0

Re: login form

Unrecognized database format 'C:\Documents and Settings\Administrator\Desktop\login\login\salesReportDataSet.xsd'.
Reputation Points: 10
Solved Threads: 0
Light Poster
lerkei is offline Offline
36 posts
since Jan 2008
Feb 6th, 2009
0

Re: login form

By the beard of Zeus, I'm guessing it doesn't know what kind of database your .xsd is..... how was it made?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Reterieve data from mdb and display in listbox
Next Thread in VB.NET Forum Timeline: How to move a SQL Server Database from One Server to another server





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC