473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Sql Ole not connecting

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.Co nnection")
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(I nt32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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.

Nov 18 '05 #1
1 2273
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.Co nnection")
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(I nt32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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.


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Google Mike | last post by:
After a lot of thought and research, and playing with FreeTDS and InlineTDS, as well as various ODBC connections, I have determined that the fastest and cheapest way to get up and going with PHP on...
2
by: Ramir Santos | last post by:
my analysis server is hosted on a win2k server with IIS, the hosting page is on another machine. I have followed everything as per MS KB article and I could not connect through the analysis server...
4
by: TP | last post by:
Hi, This is probably my 7th post of the day. not spamming, just want to get the questions out, so that I can find the answers and post them back or some good soul can help me out. Right now I...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
3
by: Jeremy Dillinger | last post by:
I am trying to design a program that will use data from a MySQL database. Currently all the data is being used with PHP scripts from a website. I am also trying to build a software solution that...
0
by: NewsReader | last post by:
Hello, I have been looking around the net for a script to help me connect to and help gather information from Cisco routers/switches. I have pieced together a couple of different scripts from...
0
by: cj.snead | last post by:
Hello, I am having trouble connecting to a remote named instance of SQL Server via Pocket PC. I have had absolutely no luck connecting with VS 2005 (even to a default instance), so I wen't back...
0
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've my win32 application which connecting to my sql database. till now i used MSDE as my database and now i want to upgrade to sql express 2005. after the upgrade i tried to connect to the...
10
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.