Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 July 16th, 2007, 06:00 AM
Authorized User
 
Join Date: Dec 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help sql connection erorr

Invalid authorization specification
Invalid connection string attribute

 
Old July 17th, 2007, 12:19 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it's really impossible to tell without posting the connection man..

POST IT ;)

Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"
 
Old July 17th, 2007, 02:17 AM
Authorized User
 
Join Date: Dec 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the code:


protected void Page_Load(object sender, EventArgs e)
    {

        //insert a provider connection string
        string connlog = "Provider=SQLOLEDB; Data Source=server; Initial Catalog = parking_sysBASE; User name =esuser; Password = ReDraw;";
        string qconn = " SELECT ime, FROM OPERATORI WHERE Username = '" + txtUsername.Text + "'";

        OleDbConnection connw = new OleDbConnection(connlog);

        connw.Open();

        OleDbCommand cmd1 = new OleDbCommand(qconn);
        //Create a datareader connection object
        OleDbDataReader Reader = cmd1.ExecuteReader(CommandBehavior.CloseConnection );


 
Old July 18th, 2007, 12:27 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I'll suppose that you are sure from the user name and password, and that you have gave this user the authority to use this data base...

first try this code instead (just to make sure :)

string connlog = "Data Source=.; Initial Catalog=parking_sysBASE; User ID=esuser; password=ReDraw;";
string qconn = " SELECT ime, FROM OPERATORI WHERE Username = '" + txtUsername.Text + "'";

sqlConnection connw = new sqlConnection(connlog);

connw.Open();

sqlCommand cmd1 = new sqlCommand(qconn);
sqlDataReader Reader = cmd1.ExecuteReader(CommandBehavior.CloseConnection );

connw.Close();

if it worked, use it :) .. if it did not.. check the authority for the 'esuser' on your database ;)

Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Connection - Chapter 9 mdfinch BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 October 23rd, 2007 12:46 AM
sql connection msrnivas .NET Web Services 1 January 26th, 2004 12:25 PM
Global SQL connection MichaelTJ .NET Web Services 16 December 16th, 2003 09:34 PM
SQL Server Connection mpeterson Classic ASP Databases 1 July 8th, 2003 09:50 PM
Connection with sql server arshad mahmood VB Databases Basics 1 June 19th, 2003 10:53 PM





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