Sql Ole not connecting

T

Thomas Scheiderich

I get an error from trying to connect to my Sql6.5 server (which is why
I am using Ole). It says the server doesn't exist or the password is
wrong. I can't understand that because I use essetially the same
connection scripts on my ASP pages and it works fine.

Here is my ASP connection that works fine:

*****************************************************************
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout = 60
connectionToDatabase.Open "Provider=sqloledb;data source=steg;" & _
"initial catalog=travdata;" & _
"user id=sa;password="
*****************************************************************

Here is my aspx page (essentially):

*****************************************************************
<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
Dim ConnectString, SelectStatement As String
Dim Connect As OleDbConnection = New OleDbConnection
Dim Adapter As OledbDataAdapter = New OleDbDataAdapter
Dim CmdBuilder As OleDbCommandBuilder
Dim ds As DataSet = New DataSet
Dim Row As DataRow

Sub Page_Load(Sender As Object, E As EventArgs)
If Not IsPostBack Then
SelectStatement = "Select * From carriers"
ConnectString = "Provider=SQLOLEDB;Data Source=steg;Initial
Catalog=travdata;uid=sa;pwd="
Connect.ConnectionString = ConnectString
Adapter.SelectCommand = _
new OleDbCommand(SelectStatement, Connect)
CmdBuilder = New OleDbCommandBuilder(Adapter)
Adapter.Fill(ds,"carriers")
end if
end sub
</script>
*****************************************************************

The error I get is:

*****************************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Source Error:


Line 41: new OleDbCommand(SelectStatement, Connect)
Line 42: CmdBuilder = New OleDbCommandBuilder(Adapter)
Line 43: Adapter.Fill(ds,"carriers")
Line 44: end if
Line 45: end sub


Source File: c:\inetpub\wwwroot\itineraryTS.aspx Line: 43

Stack Trace:


[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL
Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +36
ASP.itineraryTS_aspx.Page_Load(Object Sender, EventArgs E) in
c:\inetpub\wwwroot\itineraryTS.aspx:43
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
*****************************************************************

I know the server exists and so does the access. What am I missing?

Thanks,

Tom.
 
T

Thomas Scheiderich

I found out that it seems to be a problem with Sql 6.5 as if I change

"Source=steg" to "Source=(local)" or "Source=allosaurus"

Both the local and Allosaurus remote server are running Sql 7.0.

This was the reason I didn't use SqlConnection because I was using 6.5
and I was told that SqlConnection only worked with 7.0 and above. If I
was going to use 6.5, I needed to use OLE, which I did.

Obviously, the machine is seeing it as my ASP page works.

Tom.

Thomas said:
I get an error from trying to connect to my Sql6.5 server (which is why
I am using Ole). It says the server doesn't exist or the password is
wrong. I can't understand that because I use essetially the same
connection scripts on my ASP pages and it works fine.

Here is my ASP connection that works fine:

*****************************************************************
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout = 60
connectionToDatabase.Open "Provider=sqloledb;data source=steg;" & _
"initial catalog=travdata;" & _
"user id=sa;password="
*****************************************************************

Here is my aspx page (essentially):

*****************************************************************
<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
Dim ConnectString, SelectStatement As String
Dim Connect As OleDbConnection = New OleDbConnection
Dim Adapter As OledbDataAdapter = New OleDbDataAdapter
Dim CmdBuilder As OleDbCommandBuilder
Dim ds As DataSet = New DataSet
Dim Row As DataRow

Sub Page_Load(Sender As Object, E As EventArgs)
If Not IsPostBack Then
SelectStatement = "Select * From carriers"
ConnectString = "Provider=SQLOLEDB;Data Source=steg;Initial
Catalog=travdata;uid=sa;pwd="
Connect.ConnectionString = ConnectString
Adapter.SelectCommand = _
new OleDbCommand(SelectStatement, Connect)
CmdBuilder = New OleDbCommandBuilder(Adapter)
Adapter.Fill(ds,"carriers")
end if
end sub
</script>
*****************************************************************

The error I get is:

*****************************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------


[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Source Error:


Line 41: new OleDbCommand(SelectStatement, Connect)
Line 42: CmdBuilder = New OleDbCommandBuilder(Adapter)
Line 43: Adapter.Fill(ds,"carriers")
Line 44: end if
Line 45: end sub


Source File: c:\inetpub\wwwroot\itineraryTS.aspx Line: 43

Stack Trace:


[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL
Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +36
ASP.itineraryTS_aspx.Page_Load(Object Sender, EventArgs E) in
c:\inetpub\wwwroot\itineraryTS.aspx:43
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
*****************************************************************

I know the server exists and so does the access. What am I missing?

Thanks,

Tom.
 
M

Mary Chipman

You may have got it running, but you really ought to fix the huge
security hole you've dug for yourself by using the sa login with no
password. Although it doesn't address the older versions of SQL
Server, the asp.net security best practices white paper is worth a
read:
http://www.microsoft.com/downloads/release.asp?ReleaseID=44047

--Mary

I found out that it seems to be a problem with Sql 6.5 as if I change

"Source=steg" to "Source=(local)" or "Source=allosaurus"

Both the local and Allosaurus remote server are running Sql 7.0.

This was the reason I didn't use SqlConnection because I was using 6.5
and I was told that SqlConnection only worked with 7.0 and above. If I
was going to use 6.5, I needed to use OLE, which I did.

Obviously, the machine is seeing it as my ASP page works.

Tom.

Thomas said:
I get an error from trying to connect to my Sql6.5 server (which is why
I am using Ole). It says the server doesn't exist or the password is
wrong. I can't understand that because I use essetially the same
connection scripts on my ASP pages and it works fine.

Here is my ASP connection that works fine:

*****************************************************************
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout = 60
connectionToDatabase.Open "Provider=sqloledb;data source=steg;" & _
"initial catalog=travdata;" & _
"user id=sa;password="
*****************************************************************

Here is my aspx page (essentially):

*****************************************************************
<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
Dim ConnectString, SelectStatement As String
Dim Connect As OleDbConnection = New OleDbConnection
Dim Adapter As OledbDataAdapter = New OleDbDataAdapter
Dim CmdBuilder As OleDbCommandBuilder
Dim ds As DataSet = New DataSet
Dim Row As DataRow

Sub Page_Load(Sender As Object, E As EventArgs)
If Not IsPostBack Then
SelectStatement = "Select * From carriers"
ConnectString = "Provider=SQLOLEDB;Data Source=steg;Initial
Catalog=travdata;uid=sa;pwd="
Connect.ConnectionString = ConnectString
Adapter.SelectCommand = _
new OleDbCommand(SelectStatement, Connect)
CmdBuilder = New OleDbCommandBuilder(Adapter)
Adapter.Fill(ds,"carriers")
end if
end sub
</script>
*****************************************************************

The error I get is:

*****************************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------


[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Source Error:


Line 41: new OleDbCommand(SelectStatement, Connect)
Line 42: CmdBuilder = New OleDbCommandBuilder(Adapter)
Line 43: Adapter.Fill(ds,"carriers")
Line 44: end if
Line 45: end sub


Source File: c:\inetpub\wwwroot\itineraryTS.aspx Line: 43

Stack Trace:


[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL
Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +36
ASP.itineraryTS_aspx.Page_Load(Object Sender, EventArgs E) in
c:\inetpub\wwwroot\itineraryTS.aspx:43
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
*****************************************************************

I know the server exists and so does the access. What am I missing?

Thanks,

Tom.
 
T

Thomas Scheiderich

Mary said:
You may have got it running, but you really ought to fix the huge
security hole you've dug for yourself by using the sa login with no
password. Although it doesn't address the older versions of SQL
Server, the asp.net security best practices white paper is worth a
read:
http://www.microsoft.com/downloads/release.asp?ReleaseID=44047


I am not running on a production server, just a test machine. I
normally have a different set of logins and passwords I use.

I still can't figure out why Sql 6.5 won't work. It seems to be a
problem with .net as my ASP works fine using the same settings (unless I
am missing something).

Thanks,

Tom.
--Mary

I found out that it seems to be a problem with Sql 6.5 as if I change

"Source=steg" to "Source=(local)" or "Source=allosaurus"

Both the local and Allosaurus remote server are running Sql 7.0.

This was the reason I didn't use SqlConnection because I was using 6.5
and I was told that SqlConnection only worked with 7.0 and above. If I
was going to use 6.5, I needed to use OLE, which I did.

Obviously, the machine is seeing it as my ASP page works.

Tom.

Thomas Scheiderich wrote:

I get an error from trying to connect to my Sql6.5 server (which is why
I am using Ole). It says the server doesn't exist or the password is
wrong. I can't understand that because I use essetially the same
connection scripts on my ASP pages and it works fine.

Here is my ASP connection that works fine:

*****************************************************************
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout = 60
connectionToDatabase.Open "Provider=sqloledb;data source=steg;" & _
"initial catalog=travdata;" & _
"user id=sa;password="
*****************************************************************

Here is my aspx page (essentially):

*****************************************************************
<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
Dim ConnectString, SelectStatement As String
Dim Connect As OleDbConnection = New OleDbConnection
Dim Adapter As OledbDataAdapter = New OleDbDataAdapter
Dim CmdBuilder As OleDbCommandBuilder
Dim ds As DataSet = New DataSet
Dim Row As DataRow

Sub Page_Load(Sender As Object, E As EventArgs)
If Not IsPostBack Then
SelectStatement = "Select * From carriers"
ConnectString = "Provider=SQLOLEDB;Data Source=steg;Initial
Catalog=travdata;uid=sa;pwd="
Connect.ConnectionString = ConnectString
Adapter.SelectCommand = _
new OleDbCommand(SelectStatement, Connect)
CmdBuilder = New OleDbCommandBuilder(Adapter)
Adapter.Fill(ds,"carriers")
end if
end sub
</script>
*****************************************************************

The error I get is:

*****************************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------


[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Source Error:


Line 41: new OleDbCommand(SelectStatement, Connect)
Line 42: CmdBuilder = New OleDbCommandBuilder(Adapter)
Line 43: Adapter.Fill(ds,"carriers")
Line 44: end if
Line 45: end sub


Source File: c:\inetpub\wwwroot\itineraryTS.aspx Line: 43

Stack Trace:


[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL
Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +36
ASP.itineraryTS_aspx.Page_Load(Object Sender, EventArgs E) in
c:\inetpub\wwwroot\itineraryTS.aspx:43
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
*****************************************************************

I know the server exists and so does the access. What am I missing?

Thanks,

Tom.
 
M

Mary Chipman

Unfortunately it's been a while since I've had anything to do with
6.5, and it also happens to not be supported any more :-( You might
try posting on one of the public.sqlserver newsgroups in the hopes of
finding someone still running it who might be able to help.

--mary

Mary said:
You may have got it running, but you really ought to fix the huge
security hole you've dug for yourself by using the sa login with no
password. Although it doesn't address the older versions of SQL
Server, the asp.net security best practices white paper is worth a
read:
http://www.microsoft.com/downloads/release.asp?ReleaseID=44047


I am not running on a production server, just a test machine. I
normally have a different set of logins and passwords I use.

I still can't figure out why Sql 6.5 won't work. It seems to be a
problem with .net as my ASP works fine using the same settings (unless I
am missing something).

Thanks,

Tom.
--Mary

I found out that it seems to be a problem with Sql 6.5 as if I change

"Source=steg" to "Source=(local)" or "Source=allosaurus"

Both the local and Allosaurus remote server are running Sql 7.0.

This was the reason I didn't use SqlConnection because I was using 6.5
and I was told that SqlConnection only worked with 7.0 and above. If I
was going to use 6.5, I needed to use OLE, which I did.

Obviously, the machine is seeing it as my ASP page works.

Tom.

Thomas Scheiderich wrote:


I get an error from trying to connect to my Sql6.5 server (which is why
I am using Ole). It says the server doesn't exist or the password is
wrong. I can't understand that because I use essetially the same
connection scripts on my ASP pages and it works fine.

Here is my ASP connection that works fine:

*****************************************************************
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout = 60
connectionToDatabase.Open "Provider=sqloledb;data source=steg;" & _
"initial catalog=travdata;" & _
"user id=sa;password="
*****************************************************************

Here is my aspx page (essentially):

*****************************************************************
<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
Dim ConnectString, SelectStatement As String
Dim Connect As OleDbConnection = New OleDbConnection
Dim Adapter As OledbDataAdapter = New OleDbDataAdapter
Dim CmdBuilder As OleDbCommandBuilder
Dim ds As DataSet = New DataSet
Dim Row As DataRow

Sub Page_Load(Sender As Object, E As EventArgs)
If Not IsPostBack Then
SelectStatement = "Select * From carriers"
ConnectString = "Provider=SQLOLEDB;Data Source=steg;Initial
Catalog=travdata;uid=sa;pwd="
Connect.ConnectionString = ConnectString
Adapter.SelectCommand = _
new OleDbCommand(SelectStatement, Connect)
CmdBuilder = New OleDbCommandBuilder(Adapter)
Adapter.Fill(ds,"carriers")
end if
end sub
</script>
*****************************************************************

The error I get is:

*****************************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------


[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Source Error:


Line 41: new OleDbCommand(SelectStatement, Connect)
Line 42: CmdBuilder = New OleDbCommandBuilder(Adapter)
Line 43: Adapter.Fill(ds,"carriers")
Line 44: end if
Line 45: end sub


Source File: c:\inetpub\wwwroot\itineraryTS.aspx Line: 43

Stack Trace:


[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL
Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +36
ASP.itineraryTS_aspx.Page_Load(Object Sender, EventArgs E) in
c:\inetpub\wwwroot\itineraryTS.aspx:43
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
*****************************************************************

I know the server exists and so does the access. What am I missing?

Thanks,

Tom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top