Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 20th, 2005, 11:28 AM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default Invalid Connection String Attribute

Hi All,

Excuse me if this has been covered here before.

I have an ASP application that throws an error '80040e4d':

Invalid Connection String Attribute

Here is the DSN:
"Provider=SQLOLEDB.1;Persist Security Info=False;DSN=ProjectMan;UID=ProjectMan;Password= xxxxxxxxxx;Database=MasterProjectSQL;"

If I take out "Provider=SLQOLEDB.1;Persist Security Info=False;" out of the DSN it works fine. All my other DSNs work fine to other databases on the same server, in the same application, but not to the 'MasterProjectSQL' database.

Any ideas on what the problem is or how to configure the database to use this provider? Or should I even be using this provider?

I've read as much as I can find on this error and haven't seen this particular error addressed anywhere.....yet.

Thanks in advance for any info you have on this.

Richard

Reply With Quote
  #2 (permalink)  
Old June 21st, 2005, 06:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

For more details on connection string you can refer www.connectionstrings.com

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #3 (permalink)  
Old June 21st, 2005, 09:49 AM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Thanks HappyGV for your reply. However, I didn't see anything there that addesses the specific problem I'm having. I may have missed what you are referring to.

All of my DSNs work, even the one listed above as long as I don't use "Provider=SQLOLEDB.1;Persist Security Info=False;" in the connection string. The other databases on this same server function properly with that in the connection string to those other databases.

Do you know of any way to configure a database to use specific providers?

Thank you,
Richard

Reply With Quote
  #4 (permalink)  
Old June 22nd, 2005, 08:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What is the database server that you use? Is there any reason why you wanted to use those attributes?

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #5 (permalink)  
Old June 22nd, 2005, 11:58 AM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi Vijay,

The database server is MS SQL 2000 SP3a. And to tell you the truth I don't even know if I need to use those params or why they are used. My understanding, maybe somewhat misguided, is that the OLEDB layer is a faster more direct connection to the server, more efficient, etc. I think I copied that code from somewhere years ago and have been using it ever since. I'm havning trouble even finding any information about this syntax. I'm looking for enlightenment. What's most perplexing is that this syntax works on all of the databases on the same server except for one. It would be very simple to just not use that syntax which I'm doing now but would really like to know what this syntax is used for and what it does.

Thanks for your reply. Much appreciated.

Richard

Reply With Quote
  #6 (permalink)  
Old July 5th, 2005, 05:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Richard,

Sorry about the delayed replyto this.

I am not sure why you are trying to use DSN along with Provider. You should use either DSN or Provider.

This is how it should be if you opt not to use DSN.
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist_
             Security Info=False;Initial Catalog=YourDB;_
             Data Source=YOUR_LOCAL_SERVER_NAME"

It looks like you are mixing up both.

Here is the information on how persist security is used and why, that I read from Microsoft site.
Keep Persist Security Info as False
Setting thePersist Security Info keyword to true or yes in a connection string will allow security-sensitive information, including the user ID and password, to be obtained from the connection after the connection has been opened. If you must supply a user ID and password when making a connection, you are most protected if that information is used to open the connection and then discarded, as is the case when Persist Security Info is set to false or no. This is especially important if you are supplying an open connection to an untrusted source or persisting connection information to disk. Keeping Persist Security Info as false helps ensure that the untrusted source does not have access to the security-sensitive information for your connection and also helps ensure that no security-sensitive information is persisted to disk with your connection string information.

Persist Security Info is set to false by default.
Hope that explains.

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #7 (permalink)  
Old July 5th, 2005, 06:17 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi Vijay,

Thanks for the reply.

As I mentioned in an earlier post on this topic, I had copied this connection string years ago when I first started programming and never thought much about it since it always worked. When I started getting the "invalid connection string" error I wanted to find out what was going on here. Why would this connection string error on one SQL server and not the other and also, like you suggest, do I even need this parameter when using a DSN?

So, thank you so much for the reply. According to what you are saying, you don't need to define a provider in a DSN. OK, now I'm like the little kid that gets more questions after having the first one answered. Why don't you need to specify a provider in a DSN? Or, more importantly, if you can't specify a provider, which provider is used by default? Do I have it wrong, I was taught that OLEDB was the fastest provider, is that true?

Also, the information you posted says, " If you must supply a user ID and password when making a connection, you are most protected if that information is used to open the connection and then discarded, as is the case when Persist Security Info is set to false or no." I am supplying a username and password in my DSNs and would like not to persist security info. And why does the "Persist..." not throw an error on some servers and not on others?

Anyway, I've probably got it all screwed around sideways. I appreciate the dialogue. I want to learn it and not just get someone to answer it for me. Although, the answer is nice too, hehe.

Stay happy.

Thanks again.

Richard

Reply With Quote
  #8 (permalink)  
Old July 6th, 2005, 03:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hmmm... that's too many questions to be answered. Well I can undestand that.

DSN is something that you configure locally and have it named, which would have all the information that you use to connect to a db, the driver/provider, user name, password, db, server etc... Now when you use that for connecting to a db, you got to provide just the DSN and minimal required details along with it. Moreover DSN is configured on the system that hosts the website. Anytime the webserver changed or website is shifted, then DSN too got to be shifted along with it. DSN can be configured to use username/password or even without that. This method was old way of connecting to db.

Now every db server has its own native provider. Say for SQL server you have SQLOLEDB provider which is native to sql server and does have better performance, than using something like odbc/DSN or any other connectivity method. IMO, DSN and Provider are different from one another in terms of usage and performance. So it shouldn't be mixed and get confused.

I would suggest you read about usage of DSN and providers for db connectivity.
You can take a look at the following link to see how the connection looks with/without DSN.
http://www.webhoster.ca/webdatabase/dsnconnection.asp

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #9 (permalink)  
Old July 6th, 2005, 06:31 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi Vijay,

Yeah, unfortunately I many questions in my striving for perfection.

Thanks a million for your responses. Much appreciated.

rstelma



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error msg: Invalid connection string attribute cJeffreywang ASP.NET 2.0 Basics 3 April 28th, 2008 11:40 AM
connection string to Oracle, Invalid Argument,err sparsh2010 Access VBA 1 February 14th, 2008 08:31 AM
Invalid class string - : 0x800401F3 not24 C# 2005 1 March 16th, 2006 04:53 PM
Unable to get connection, DataSource invalid: prob protozoa JSP Basics 1 August 19th, 2004 02:40 AM
Invalid ProgID attribute kimmy VB Components 1 August 4th, 2004 10:59 PM



All times are GMT -4. The time now is 08:02 PM.


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