Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 5th, 2005, 08:09 AM
sunpalozzi sunpalozzi is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 21 sunpalozzi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 46 m 41 sec
Reputation Power: 0
Unhappy ado connectionstring to sql 2000

Hello all,

I am getting the following error message when I try to connect to my sql server (sql 2000) from our web server (windows 2003) through a odbc connection. The connection works fine from the ODBC data source administrator.

Error Message: -2147467259(80004005)
[DBNETLIB][ConnectionOpen([Connect()]) SQL SERVER does not exist or access denied.
This is the my connection string:

cnADO.ConnectionString = "Provider=SQLOLEDB;Data Source=mydata;Server=mySQL;User ID=sa;Password=mypassword;"
Please help...

Sherry

Reply With Quote
  #2  
Old May 5th, 2005, 09:59 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 16th Plane (12500 - 12999 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 21 m 57 sec
Reputation Power: 1762
Try this:
Code:
cnADO.ConnectionString  = "Provider=SQLOLEDB;Data Source=name_of_server;Initial Catalog=name_of_database;User Id=sa;Password=mypassword"

Reply With Quote
  #3  
Old May 5th, 2005, 10:42 AM
sunpalozzi sunpalozzi is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 21 sunpalozzi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 46 m 41 sec
Reputation Power: 0
mehere:
I tried the connectionstring you suggested above and I got this error: run-time error: 3001.
Arguments are of wrong type, are out of acceptible range or in conflict with one another.
What did I do wrong?
Sherry

Reply With Quote
  #4  
Old May 5th, 2005, 10:50 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 16th Plane (12500 - 12999 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 21 m 57 sec
Reputation Power: 1762
That's the connection string I normally use.
ie:
Code:
set Conn = Server.CreateObject("ADODB.Connection")
DSNName = "Provider=SQLOLEDB;Data Source=name_of_server;Initial Catalog=name_of_database;User Id=sa;Password=mypassword"
Conn.ConnectionString = DSNName
Conn.Open


Not sure where the issue is coming from. I've never run into a problem.

Here's a link you may want to look at.
http://www.connectionstrings.com/

Reply With Quote
  #5  
Old May 5th, 2005, 10:51 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 16th Plane (12500 - 12999 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 21 m 57 sec
Reputation Power: 1762
Post the whole code, error message and highlight the line the error is referring to.

Reply With Quote
  #6  
Old May 5th, 2005, 12:19 PM
sunpalozzi sunpalozzi is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 21 sunpalozzi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 46 m 41 sec
Reputation Power: 0
mehere:
I got this error message:Run-time error: 424, object required.
The code:
Set cnADO = Server.CreateObject("ADODB.Connection")
DSNName = "Provider=SQLOLEDB;Data Source=TRSBSQL;
Initial Catalog=TR_Services_MSCRM;User Id=sa;Password=dummy"
cnADO.ConnectionString = DSNName
cnADO.Open

Reply With Quote
  #7  
Old May 5th, 2005, 12:33 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 16th Plane (12500 - 12999 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 21 m 57 sec
Reputation Power: 1762
Is the line the error message on referring to the connection string? Is your connection string on seperate lines like you're showing in the above message?

If so, try:
Code:
DSNName = "Provider=SQLOLEDB;Data Source=TRSBSQL;" & _
"Initial Catalog=TR_Services_MSCRM;User Id=sa;Password=dummy"


You would need to concantenate your 2 seperate lines.

Reply With Quote
  #8  
Old May 5th, 2005, 01:29 PM
sunpalozzi sunpalozzi is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 21 sunpalozzi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 46 m 41 sec
Reputation Power: 0
same error.
sherry

Reply With Quote
  #9  
Old May 5th, 2005, 05:27 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 16th Plane (12500 - 12999 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 21 m 57 sec
Reputation Power: 1762
How about this then:
Code:
DSNName = "Driver={SQL Server};" & _
				"Server=TRSBSQL;" & _		
				"Database=TR_Services_MSCRM;" & _
				"Uid=sa;Pwd=dummy;"


They're the only two connection strings I know. If all your names are correct, then I don't know what the problem is.
Comments on this post
sunpalozzi agrees: it is a winner... Thank you for all your time on helping me on this pain...

Reply With Quote
  #10  
Old May 5th, 2005, 10:20 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
Try using the sql server's IP address rather than the server name.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #11  
Old May 17th, 2005, 03:46 PM
buckeyedoug buckeyedoug is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 1 buckeyedoug User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 13 sec
Reputation Power: 0
I had the same problem recently, with sql server 2000& Windows 2003 svr, got the same error message.

I went to:
C:\Program Files\Microsoft SQL Server\80\Tools\Binn
(Might be different on your install) and opened the SQL Server Network Utility
(SVRNETCN)
and made sure I enabled a connection protocol. I opened TCP/IP
For some reason on my machine, all the connection protocols had been deleted.
Good Luck.

Quote:
Originally Posted by sunpalozzi
Hello all,

I am getting the following error message when I try to connect to my sql server (sql 2000) from our web server (windows 2003) through a odbc connection. The connection works fine from the ODBC data source administrator.

Error Message: -2147467259(80004005)
[DBNETLIB][ConnectionOpen([Connect()]) SQL SERVER does not exist or access denied.
This is the my connection string:

cnADO.ConnectionString = "Provider=SQLOLEDB;Data Source=mydata;Server=mySQL;User ID=sa;Password=mypassword;"
Please help...

Sherry

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > ado connectionstring to sql 2000


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |