Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2005, 05:23 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.Data.SqlClient.SqlException

I am trying to get some code to work from the book and I keep getting an error.

"An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error."

I get the error at the 'objConnection.Open()' line

Here is the objConnection defined:
Dim objConnection As New SqlConnection("server=(local);database=pubs;user id=administrator;password=all")

I can connect to the db via the tools menu and every other way I have tested, just not via my code which is just as it it described to me in the book.

Any help would be greatly appreciated.

 
Old January 3rd, 2005, 05:46 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it. I changed how I was authenticating with the server.

From:
'Dim objConnection As New _
    'SqlConnection("server=(barsitech);database=pubs;u ser id=sa;password=")


To:
Dim objconnection As SqlConnection = New _
        SqlConnection("server=barsitech;integrated security=SSPI;initial catalog=pubs;")

 
Old August 13th, 2005, 09:39 PM
Registered User
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

not did you help yourself you helped me too!!!! THANKS!!!!, how and where did you figure this out?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing System.Data.SQLClient dll mike_abc VB.NET 2 June 3rd, 2011 10:18 PM
System.Data.SqlClient.SqlDataReader - URGENT wk ASP.NET 2.0 Basics 8 September 27th, 2006 05:00 AM
'SYSTEM.DATA.SQLCLIENT.SQLEXCEPTION' soorsha General .NET 0 September 23rd, 2006 11:59 PM
System.Data.SqlClient.SqlException: Login failed f belete SQL Server 2005 3 May 18th, 2006 08:18 AM
Data.SqlClient.SqlException: Login failed csun ASP.NET 1.0 and 1.1 Basics 3 October 15th, 2004 03:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.