English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I made the code :

<%@Import Namespace=System.Data%>
<%@Import Namespace=System.Data.SQLclient%>



IE said: SQL SERVER doesn't exist or the visit is confuseed .

what's wrong ,can anybody help me ? thanks

2007-01-15 14:50:54 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

I have connected to dozens of databases believe me this works or your database is not running at all or a firewall is blocking the sql server port listening for connections (the default is 1433) or you did not set up your sql server to listen for external connections (I have done that several times). Go to the ODBC connections in the administrative tools and click the system tab and see if odbc can set up a successful connection if not the code below will not work either. If you do get a successful connection you can always modify your code to use the odbc connection. It is slower but it will get you up and running.


This is what I would use to do a database connection (without the ODBC) to sql server.

Dim Scon As SQLConnection =new SQLConnection("server=
localhost;" & _
"database=master;" & _
"uid=sa;pwd=123;")

Scon.open()
Scon.close()
Scon = Nothing 'call the garbage collector to free the resources
end sub

make sure you have the trailing simicolon after the password. Change the server to whatever ipaddress or network name the computer has that is running sql server.

Note that if you are using sql express, it does not listen for external connections with the defalut install. Only the full blown sql server by default does that. So you will have to change the configuration and restart the sql server.

You may also want to go into the security and make sure the sa account's password and access is correct.

Hope that helps.

RJ

2007-01-17 06:04:44 · answer #1 · answered by Anonymous · 0 0

http://answers.yahoo.com/question/index;_ylt=Aoe3a22yxEtGi0yzMkRL7nDsy6IX?qid=20061227143022AANX5YJ&show=7#profile-info-AA11469553

There is many to solve this problem.
This is the step if you can control and login to both (SQL and web) server
1. Open Control Panel-> Administrative Tools -> Service -> MSSQL or some thing like SQL express.. is start or not.
2. If you have enterprise manager -> Change server to "Mix mode" of it cannot be connect via SQL auth.
3.. Use Open Control Panel-> Administrative Tools -> ODBC to test, You can put your username and pass for sql.
4. If SQL server and Webserver is different, try to ping SQL server from Webserver, sometime Server name is not work because of DNS...

2007-01-15 17:07:34 · answer #2 · answered by Jason L 5 · 0 0

Wow, that sounds confusing, and I'm the SQL expert....

Try this:

MM_Connection = "Provider=SQLOLEDB; Data Source=Your_Server_Name; Initial Catalog= Your_Database_Name; UserId=Your_Username; Password=Your_Password;"

Recordset1.Source = "SELECT * FROM something"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>

<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>

<%
Recordset1.MoveNext()
Wend
%>


<%recordset1.close()%>


Where it says Data Source= Your Server Name,
you can replace that with a host name or an IP#, both will work.

Note the hostname would not be yourdomain.com, but would be the hostname of the SQL server (perhaps: sql.yourhost.com)

2007-01-15 14:56:25 · answer #3 · answered by SharpGuy 6 · 0 0

the relationship string is going to rely on your interior reach setup. that's not something we are able to help you to with. you will might desire to renowned the direction to the server, the sq. Server account login and password and so on.

2016-10-07 05:39:11 · answer #4 · answered by ? 4 · 0 0

fedest.com, questions and answers