Click here to Skip to main content
16,004,927 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Documnet Parser Pin
Paul Conrad27-Dec-06 7:22
professionalPaul Conrad27-Dec-06 7:22 
QuestionPreventing automatic vars changes in Multiple Child Forms Pin
NigeLost26-Dec-06 8:34
NigeLost26-Dec-06 8:34 
AnswerRe: Preventing automatic vars changes in Multiple Child Forms Pin
Dave Kreskowiak26-Dec-06 8:47
mveDave Kreskowiak26-Dec-06 8:47 
GeneralRe: Preventing automatic vars changes in Multiple Child Forms Pin
NigeLost26-Dec-06 9:09
NigeLost26-Dec-06 9:09 
GeneralRe: Preventing automatic vars changes in Multiple Child Forms Pin
Dave Kreskowiak26-Dec-06 10:51
mveDave Kreskowiak26-Dec-06 10:51 
GeneralRe: Preventing automatic vars changes in Multiple Child Forms Pin
NigeLost26-Dec-06 11:25
NigeLost26-Dec-06 11:25 
QuestionGetting information from the database Pin
Aigini26-Dec-06 4:34
Aigini26-Dec-06 4:34 
AnswerRe: Getting information from the database Pin
Agus Budianto26-Dec-06 17:28
Agus Budianto26-Dec-06 17:28 
hope this little code will help you. here i am assuming that in 'customerdetails' table there are fields called 'uname' and 'pwd'. you call this function from you code and check for its return value, if it's true then the login is valid, or otherwise its invalid.

for the ConStr property contain connectionstring that will be used to connect to the database, you can use something like this : 'provider=microsoft.jet.oledb.4.0;data source=d:\database\BankingMS.mdb' where you can replace 'd:\database\BankingMS.mdb' with you actual database location.

'before placing this code, make sure you have imported system.data.oledb

public function IsLoginValid(byval ConStr as string, byval UName as string, byval Password as string) as boolean
   dim c as new oledbconnection(ConStr)
   dim cmd as oledbcommand=c.createcommand
   dim da as new oledbdataadapter(cmd)
   dim dr as oledbdatareader
   with cmd
      .commandtext="select pwd from customerdetails where uname='" & _ 
      uname.trim & "'"
      try
         dr=.executereader
      catch x as exception
         messagebox.show("Cant connect to database.")
      finally
         c.close
      end try
   end with
   if dr.hasrows then
      dr.read
      if cstr(dr("pwd")).trim=password.trim then
         return true
      else
         return false
      end if
   else
      return false
   end if
end function

Questionmaking the column readonly Pin
RAJWANTMISHRA26-Dec-06 4:30
RAJWANTMISHRA26-Dec-06 4:30 
AnswerRe: making the column readonly Pin
Janani Divya27-Dec-06 1:20
Janani Divya27-Dec-06 1:20 
GeneralRe: making the column readonly Pin
RAJWANTMISHRA27-Dec-06 5:19
RAJWANTMISHRA27-Dec-06 5:19 
QuestionPreventing automatic variable changes in Multiple Child Forms Pin
NigeLost26-Dec-06 3:52
NigeLost26-Dec-06 3:52 
AnswerRe: Preventing automatic variable changes in Multiple Child Forms Pin
Dave Kreskowiak26-Dec-06 6:36
mveDave Kreskowiak26-Dec-06 6:36 
QuestionUrgent Pin
vin107025-Dec-06 23:12
vin107025-Dec-06 23:12 
AnswerRe: Urgent Pin
Colin Angus Mackay26-Dec-06 0:09
Colin Angus Mackay26-Dec-06 0:09 
AnswerRe: Urgent Pin
Dave Kreskowiak26-Dec-06 2:38
mveDave Kreskowiak26-Dec-06 2:38 
GeneralRe: Urgent Pin
Paul Conrad26-Dec-06 16:07
professionalPaul Conrad26-Dec-06 16:07 
QuestionRemoting Pin
nitin_ion25-Dec-06 22:55
nitin_ion25-Dec-06 22:55 
AnswerRe: Remoting Pin
Dave Kreskowiak26-Dec-06 2:39
mveDave Kreskowiak26-Dec-06 2:39 
GeneralRe: Remoting Pin
nitin_ion26-Dec-06 17:09
nitin_ion26-Dec-06 17:09 
GeneralRe: Remoting Pin
Dave Kreskowiak27-Dec-06 1:25
mveDave Kreskowiak27-Dec-06 1:25 
QuestionDrag & Drop Problem Pin
Taylor Kobani25-Dec-06 20:53
Taylor Kobani25-Dec-06 20:53 
AnswerRe: Drag & Drop Problem Pin
Christian Graus25-Dec-06 22:21
protectorChristian Graus25-Dec-06 22:21 
GeneralRe: Drag & Drop Problem Pin
Taylor Kobani27-Dec-06 20:24
Taylor Kobani27-Dec-06 20:24 
QuestionUnable to resolve type Error Pin
bprashant25-Dec-06 19:56
bprashant25-Dec-06 19:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.