Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question: SQLClient in ASP.Net

Status
Not open for further replies.

info25

Programmer
Apr 18, 2002
5
SG
Hi
Whenever I tried accessing my SQL Server 7.0 database with SQLConnection in ASP.Net, I always get the error: 'Specified SQL server not found'. My code is like:

Dim Con As New SQLConnection("server=SQLSRV;database=northwind")
Conn.open()

SQLSRV is the name of my SQL server on the network. In the ASP days, I usually use DSN to access the SQL server and all works OK.
Can anyone tell me what I should do to corrrect this?
And should I specify user id and password for the connection string? Are they the same as the DSN UID and pwd?
I think I can do it in DSN way, but I need to download ODBC.Net data provider, but it requires MDAC 2.7 or later. And Micosoft's MDAC download page says: 'Due to issues with clustering, this release is currently NOT supported on SQL Server 7.0 Servers or SQL 6.5 Clustered Servers. '! Huh? Does this mean I can't use ODBC?
Oh BTW, I just installed MDAC 2.6 on the web server. Can that be the cause of the problem?
Thanks!
 
I would try just creating a .udl file for the connection to your sql server. Once created test it and make sure the connection succeeded. If all is well you could open the .udl file in notepad and copy out the connection string. Then set the connection string of your connection object to this string you copied and all should be well. I know for me the .udl file has been the easiest means for me providing a valid connection string without having to remember everything. You should be able to use the OLE db provider for sql server and get away from using odbc unless you have to for some reason.

I don't know if this helps but it is my 1/2 cent worth.
 
And here is my 1/2 cent worth (actually, even less than that):

Can your client 'see' the server on the network? i.e. can ping by machine name
 
Hmm I tried pinging the SQL server (by machine name and IP) but it didn't respond (request timed out) even though the SQL server machine is visible from the network neighbourhood.
Any ideas why this happens?
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top