Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    9

    Unanswered: Not supplying the password

    I am not supplying the password. I have used the following entries in the setup.ini file while installing the MSDE
    [Options]
    INSTANCENAME=TEST
    SECURITYMODE=SQL
    BLANKSAPWD=1

    I think i no need a password here. I have also tried with password it is giving same problem. here the code...
    Dim cnfordesktop As New System.Data.SqlClient.SqlConnection

    '--------------------------------------------------------------------------
    ' Open the desktop connection
    '--------------------------------------------------------------------------
    Public Function OpenConnectionForDeskTop() As Boolean
    Dim cnstr As String = ConnectionStringForDeskTop()
    Try
    cnfordesktop = New system.Data.SqlClient.SqlConnection(cnstr)
    cnfordesktop.Open()
    Catch e As SqlClient.SqlException
    MessageBox.Show("Error Number: " & e.Number & ", Error Message: " & e.Message & ", Command: " & cnstr, "Database ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
    Return False
    End Try
    Return True
    End Function
    '--------------------------------------------------------------------------
    'close the connection
    '--------------------------------------------------------------------------
    Public Sub CloseConnectionForDesktopVM()
    Try
    cnfordesktop.Close()
    Catch ex As Exception

    End Try
    End Sub
    '--------------------------------------------------------------------------
    'Set the connection string property
    '--------------------------------------------------------------------------
    Public Function ConnectionStringForDeskTop() As String
    Dim cs As String = ""
    cs = "data source=mypc\test;initial catalog=test;user id=sa;password=;persist security info=False;"
    Return cs
    End Function

  2. #2
    Join Date
    Nov 2003
    Posts
    9

    Re: Not supplying the password

    Please ignore this post.

    Originally posted by venki
    I am not supplying the password. I have used the following entries in the setup.ini file while installing the MSDE
    [Options]
    INSTANCENAME=TEST
    SECURITYMODE=SQL
    BLANKSAPWD=1

    I think i no need a password here. I have also tried with password it is giving same problem. here the code...
    Dim cnfordesktop As New System.Data.SqlClient.SqlConnection

    '--------------------------------------------------------------------------
    ' Open the desktop connection
    '--------------------------------------------------------------------------
    Public Function OpenConnectionForDeskTop() As Boolean
    Dim cnstr As String = ConnectionStringForDeskTop()
    Try
    cnfordesktop = New system.Data.SqlClient.SqlConnection(cnstr)
    cnfordesktop.Open()
    Catch e As SqlClient.SqlException
    MessageBox.Show("Error Number: " & e.Number & ", Error Message: " & e.Message & ", Command: " & cnstr, "Database ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
    Return False
    End Try
    Return True
    End Function
    '--------------------------------------------------------------------------
    'close the connection
    '--------------------------------------------------------------------------
    Public Sub CloseConnectionForDesktopVM()
    Try
    cnfordesktop.Close()
    Catch ex As Exception

    End Try
    End Sub
    '--------------------------------------------------------------------------
    'Set the connection string property
    '--------------------------------------------------------------------------
    Public Function ConnectionStringForDeskTop() As String
    Dim cs As String = ""
    cs = "data source=mypc\test;initial catalog=test;user id=sa;password=;persist security info=False;"
    Return cs
    End Function

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Well if it's using windows security, sa is probably not in a windows work group...

    But I think you said it's MSDE...so I'm not sure.

    Can you add your user id to the database as a logon and a user, grant yourself sa, and try with that...

    Again just a guess...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •