Trying to connect on my local machine

  • I am trying to connect with VB 2008 onto SQL Server 2005 on my local machine. But I get an error:

    Here is my script behind the form:

    '* Configure connection object connection string to be used throughout

    '* the form.

    sqlConNW.ConnectionString = _

    "Data Source=(local);Initial Catalog=Northwind;Integrated Security=True"

    '* Open database connection

    If sqlConNW.State = ConnectionState.Closed Then

    sqlConNW.Open() << ERROR HERE "Login failed for user 'Ray-PC\Ray'
    End If

    What can I do to get in?

  • Try this and see if it works:

    'In project references you MUST select

    ' Microsoft OLE DB Service Component 1.0 Type Library

    ' This in turn loads oledb32.dll into your project

    ' then

    '

    ' In project reference you MUST select

    ' Microsof ActiveX Data Objects 2.8 Library

    ' This in turn loads Msado15.dll into your project

    '

    Dim objMSDAC As MSDASC.DataLinks

    Set objMSDAC = New MSDASC.DataLinks

    Cnn_String = objMSDAC.PromptNew

    Cnn.ConnectionString = Cnn_String

    This will display a form (contained within oledb32.dll),

    click on all the forms buttons - you can create the

    connection string and test if it functions properly.

    I would set a break point on the code in

    the line above and display the string using the debugger.

    Let me know if the above works for you.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Is the Ray-PC\Ray account an administrator on the PC?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply