Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO.net and VB.NET connection errors
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00616414
Message ID:
00616658
Views:
35
For the interested person, with the try and catch option, I was able to determine the errors that was related to the login access, especially this entry “Integrated Security=SSPI” in the connectstring.

Here are all steps to create the DATAREADER in VB.NET.

Dim strsql As String
Dim strerror As String
Dim strconn As String
Dim objcommand As SqlClient.SqlCommand
Dim objDR As SqlClient.SqlDataReader
Dim strresult As String

Try
strconn = "Initial Catalog=Soutiens;Data Source=CBCINC-SERVER;User ID=administrator;Integrated Security=SSPI;"
strsql = "select * from project"
objcommand = New SqlClient.SqlCommand(strsql, New SqlClient.SqlConnection(strconn))
objcommand.Connection.Open()

objDR = objcommand.ExecuteReader(CommandBehavior.CloseConnection)

With objDR
Do While .Read = True
strresult = .GetString(1)
Console.WriteLine(strresult)
Loop
.Close()
End With

Catch objException As Exception

'Display the exception message
strerror = objException.Message
If Not IsNothing(objException.InnerException) Then
strerror += objException.InnerException.Message
End If
MsgBox(strerror)

End Try


Thanks.


>Hi Dave,
>
>Actually, with the « server explorer », I can access the table with out any trouble.
>
>And the connectstring is as follow,
>
>Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=administrator;Initial Catalog=Soutiens;Data Source=CBCINC-SERVER;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=CBCINC-XP;Use Encryption for Data=False;Tag with column collation when possible=False
>
>I did try this one also with the same error.
>
>One thing I did notice is the fact the driver property is equal to this,
>
>Microsoft OLE DB Provider for SQL Server
>
>Is there anything special to do, to force the connection to be ADO.NET my server being SQL server 2000 (Version 8.00) ??
>
>From one book I have VB.NET pro, they mention that ADO.NET will not use the entry « provider = » when ADO is in effect ??
>
>I will try your code and let you know.
>
>Thanks for the reply…
>
>Carl
>
>
Carl Barbeau.
Analyst Designer office systems.
Carl Barbeau consultant Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform