July 3, 2009 at 3:20 pm
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?
July 3, 2009 at 3:55 pm
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.
July 6, 2009 at 8:24 am
Is the Ray-PC\Ray account an administrator on the PC?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply