login Form using Access database

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 72
Reputation: geetajlo is an unknown quantity at this point 
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

login Form using Access database

 
0
  #1
Oct 24th, 2007
hi i just want my form to connect to a database. and also i want my password in my textbox to be encrpted .
i want it to check in the database if password and user = true then display next form and the login form should be close whenever i get the next form. need help plzzzzzz
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: login Form using Access database

 
0
  #2
Oct 24th, 2007
man,its simple task-
dont worry,just create textbox& in properties make textmode-has password.to check whether name exists or not in password
private sub btn_check(sender,object)
Dim str AsString = "select ID from table1 where ID = '" & txtid.Text & "'"
Dim con As String = ConfigurationManager.AppSettings("preeconn")
Dim com As New SqlCommand(str, New SqlConnection(con))
com.Connection.Open()
'Dim ds As New DataSet
Dim da As New SqlDataAdapter(str, con)
'dataadapter is used to populate(or fill) dataset with data .we use fill method....
Dim dr As SqlDataReader
'da.Fill(ds, "table1")
dr = com.ExecuteReader 'where sqldatareader ain't run without using sqlcommand
'executereader,executenonquery are methods of sqlcommand....
'hasrows,fieldcount...are methods of datareader....
If Not dr.Read() Then
label4.Text = "id doesnt exists"
Else
label4.Text = "id exists"
End If
End Sub
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 72
Reputation: geetajlo is an unknown quantity at this point 
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

login Form using Access database

 
0
  #3
Oct 28th, 2007
hi
the ConfigurationManager.AppSettings is not working in my visual basic 2005. can u help me . it tells me that i have to declare it ..... Help Plz
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 121
Reputation: manal is an unknown quantity at this point 
Solved Threads: 17
manal's Avatar
manal manal is offline Offline
Junior Poster

Re: login Form using Access database

 
0
  #4
Oct 31st, 2007
i think you just need to add reference to System.configuration.dll
"give only what u willing to receive "
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 2
Reputation: vekeneswari is an unknown quantity at this point 
Solved Threads: 0
vekeneswari vekeneswari is offline Offline
Newbie Poster

Re: login Form using Access database

 
0
  #5
Nov 3rd, 2007
I tried create login form with following code:
Code
Dim str As String = "SELECT [userID], [passid] FROM user WHERE [userid]='" & txtUsername.Text & "' and [passid] = '" & txtPassword.Text & "'"
Dim con As String = ConfigurationManager.AppSettings("preeconn")
Dim com As New SqlClient.SqlCommand(Str, New SqlClient.SqlConnection(con))
com.Connection.Open()
'Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter(Str, con)
'dataadapter is used to populate(or fill) dataset with data .we use fill method....
Dim dr As SqlClient.SqlDataReader
'da.Fill(ds, "table1")
dr = com.ExecuteReader 'where sqldatareader ain't run without using sqlcommand
'executereader,executenonquery are methods of sqlcommand....
'hasrows,fieldcount...are methods of datareader....
If Not dr.Read() Then
MessageBox.Show("Invalid user name, try again!", "Invalid Info")
'label4.Text = "id doesnt exists"
Else
Form2.Show()
'label4.Text = "id exists"
End If

It show error Invalidoperationexception was unhandled "The connectionstring property has not been initialized.

Please advice me. I try create login form more then 1 month. I need it very urgent.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1
Reputation: wd60152 is an unknown quantity at this point 
Solved Threads: 0
wd60152 wd60152 is offline Offline
Newbie Poster

Re: login Form using Access database

 
0
  #6
Nov 6th, 2007
It is not clear to me that you have actually added a connection string to the app.config file. Be sure that the application settings parameter "preecon" has a valid DB connection string as it's value. The following is a sample of a SQL Server connection string in a local app.config file; I am not sure what an Access connection string would look like.

<configuration>
<appSettings>
<add key="preecon" value="server=HOSTNAME;database=DBNAME;Security=SSPI"/>
</appSettings>
</configuration>

Cheers,

BD
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