Click here to Skip to main content
15,911,762 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: calling exe Pin
kadkir20-Jun-08 17:42
kadkir20-Jun-08 17:42 
GeneralRe: calling exe Pin
LloydA11121-Jun-08 15:24
LloydA11121-Jun-08 15:24 
QuestionVB 6.0 & CR9 "Load Report Failed" error 50003 Pin
zomby80200319-Jun-08 19:52
zomby80200319-Jun-08 19:52 
QuestionVB 6.0 & CR9 "Load Report Failed" error 50003 Pin
zomby80200319-Jun-08 19:51
zomby80200319-Jun-08 19:51 
Questionvb6 string truncated Pin
AJ du Plessis19-Jun-08 19:18
AJ du Plessis19-Jun-08 19:18 
AnswerRe: vb6 string truncated Pin
Christian Graus19-Jun-08 20:10
protectorChristian Graus19-Jun-08 20:10 
GeneralRe: vb6 string truncated Pin
AJ du Plessis19-Jun-08 20:25
AJ du Plessis19-Jun-08 20:25 
QuestionPassing value within form and function VB.NET 2003 Pin
drexler_kk19-Jun-08 16:14
drexler_kk19-Jun-08 16:14 
Dear all,

I have a problem with passing the return Boolean.This project is running with VB.NET 2003 with MySQL database. I'm using a Function to call a login verification as shown below:
Public Function FurtherUser_Authenticate() As Boolean
        Dim FrmAuthen As New FrmAuthen
        FrmAuthen.StartPosition = FormStartPosition.CenterScreen
        FrmAuthen.Show()

End Function



And next I will prompup a form for the user to insert username and password for further verification. This will check
the user login name and password from MySQL database for verification. After success verification I would like to return
UserVerifySuccess = True to my function and the function will allowed the user to do some Setting on my window form application.

The following are the code for loading of the FormSetting which need a further user verification to login because of security issues
of the user:
Private Sub FrmSetting1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

  blnMustAuthenticate = True

  If blnMustAuthenticate Then
         UserVerifySuccess = False
         Me.Close()
            
         Further_Authenticate()
            
            If UserVerifySuccess = True Then
                Me.Show()
            End If
  End If


  End Sub



The code that used at FrmAuthen to check the user is allowed to do the setting is below:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim x, pass As String
        Try
            ObjComm = New OdbcCommand("SELECT POS_CASHIER.LocationCode, CashierID, CashierName, Pwd, IF(POS_CASHIER.IsActive=1 AND POS_CASHIERGROUP.IsActive, 1, 0) AS IsActive, CanChangePwd, POS_CASHIER.GroupID, GroupName, IsFullAccess  FROM POS_CASHIER INNER JOIN POS_CASHIERGROUP ON POS_CASHIER.GROUPID = POS_CASHIERGROUP.GROUPID AND POS_CASHIER.LocationCode = POS_CASHIERGROUP.LocationCode WHERE CashierID='" & TextBox1.Text & " ' ", ObjConn)
            ObjConn.Open()
            ObjRead = ObjComm.ExecuteReader
            If ObjRead.Read Then
                pass = ObjRead.Item(3)
                x = ObjRead.Item(8)
                ObjConn.Close()
                If TextBox2.Text = pass Then
                    If x = "1" Then

                        Me.Hide()
                        Return (UserVerifySuccess = True)  ' << I need to return this to my function. Thank you~!

                    Else
                        ObjConn.Close()
                        MessageBox.Show("Sorry. You are not allowed to run this task.")

                    End If
                Else
                    ObjConn.Close()
                    MessageBox.Show("Your password is invalid.")
                End If
            Else
                ObjConn.Close()
            End If

        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            ObjConn.Close()
        End Try


    End Sub




Thats all I need someone can give me a guide whats the problem with my code here? Anyone can give me some idea/solution?

Thanks for reading.

Regards
Drex
AnswerRe: Passing value within form and function VB.NET 2003 Pin
Christian Graus19-Jun-08 18:41
protectorChristian Graus19-Jun-08 18:41 
QuestionRe: Passing value within form and function VB.NET 2003 Pin
drexler_kk19-Jun-08 19:31
drexler_kk19-Jun-08 19:31 
Questionhow can i print my form axacly like itself Pin
Nika Asgari19-Jun-08 11:47
Nika Asgari19-Jun-08 11:47 
AnswerRe: how can i print my form axacly like itself Pin
Christian Graus19-Jun-08 12:13
protectorChristian Graus19-Jun-08 12:13 
GeneralRe: how can i print my form axacly like itself Pin
Nika Asgari19-Jun-08 12:18
Nika Asgari19-Jun-08 12:18 
GeneralRe: how can i print my form axacly like itself Pin
Christian Graus19-Jun-08 18:44
protectorChristian Graus19-Jun-08 18:44 
GeneralRe: how can i print my form axacly like itself Pin
Nika Asgari19-Jun-08 22:04
Nika Asgari19-Jun-08 22:04 
AnswerRe: how can i print my form axacly like itself Pin
jzonthemtn19-Jun-08 12:36
jzonthemtn19-Jun-08 12:36 
GeneralRe: how can i print my form axacly like itself Pin
Nika Asgari19-Jun-08 22:08
Nika Asgari19-Jun-08 22:08 
QuestionTrimEnd(..) Pin
iltallman19-Jun-08 11:28
iltallman19-Jun-08 11:28 
AnswerRe: TrimEnd(..) Pin
Christian Graus19-Jun-08 12:14
protectorChristian Graus19-Jun-08 12:14 
Question? - Can I use multiple PPT Interop references Pin
normschaef19-Jun-08 6:52
normschaef19-Jun-08 6:52 
QuestionVBA: From Excel to Outlook Pin
Bienchen19-Jun-08 6:23
Bienchen19-Jun-08 6:23 
QuestionForm Load and Re-load - Slow Pin
Andy20219-Jun-08 6:01
Andy20219-Jun-08 6:01 
AnswerRe: Form Load and Re-load - Slow Pin
nlarson1119-Jun-08 10:37
nlarson1119-Jun-08 10:37 
Questionaccessing database from window service Pin
Ebube19-Jun-08 5:59
Ebube19-Jun-08 5:59 
AnswerRe: accessing database from window service Pin
Ashfield19-Jun-08 6:22
Ashfield19-Jun-08 6:22 

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.