Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Jonathan Blac » Wed, 21 Aug 2002 01:03:36



I am using a distant webhoster to run a classic asp program (not .net) which
used to connect to an sql server database again which they hosted.

A dsnless connection string similair to the following worked fine:

strCon = "Provider=sqloledb;" & _ "Data Source=233.77.166.2;" & _ "Network
Library=dbnmpntw;" & _ "Initial Catalog=databaseexample;" & _ "User
ID=webmasterofsite;" & _ "Password=4444;"

The strings details have been changed for security purposes but are similair
in type to the real string.

Now on the webhoster upgrading to sql server 2000 this connection string
stopped working.

However I can still connect using the same ip address and login details
through sql 2000 enterprise manager and through the access adp front end.

The error message I now get through asp is:

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.

Here is the full code for the connection routine:

strCon = "Provider=sqloledb;"
& _ "Data Source=233.77.166.2;"
& _ "Network Library=dbnmpntw;"
& _ "Initial Catalog=databaseexample;"
& _ "User ID=webmasterofsite;"
& _ "Password=4444;"
set Con = server.CreateObject("adodb.Connection")
con.open strCon

 set rs = con.execute("update counter set HitCount = ((HitCount) + 1) where
ID = 1")

 con.close
 set rs = nothing
 set con = nothing
if Request.Cookies("publicregistered")="True" then
 Response.Redirect("startSql.asp")
end if

Thanks

Jonathan

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Curt_ » Wed, 21 Aug 2002 00:13:38


I'm guessing here but I'm betting they switched to Windows Authentication
for their SQL Server and not "Mixed Mode". You may have to pass in a valid
NT user account instead of a SQL user account.....
Just a guess, but I'd ask them what authentication mode they are using for
their SQL box.

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------


Quote:> I am using a distant webhoster to run a classic asp program (not .net)
which
> used to connect to an sql server database again which they hosted.

> A dsnless connection string similair to the following worked fine:

> strCon = "Provider=sqloledb;" & _ "Data Source=233.77.166.2;" & _ "Network
> Library=dbnmpntw;" & _ "Initial Catalog=databaseexample;" & _ "User
> ID=webmasterofsite;" & _ "Password=4444;"

> The strings details have been changed for security purposes but are
similair
> in type to the real string.

> Now on the webhoster upgrading to sql server 2000 this connection string
> stopped working.

> However I can still connect using the same ip address and login details
> through sql 2000 enterprise manager and through the access adp front end.

> The error message I now get through asp is:

> Microsoft OLE DB Provider for SQL Server error '80004005'

> [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
> denied.

> Here is the full code for the connection routine:

> strCon = "Provider=sqloledb;"
> & _ "Data Source=233.77.166.2;"
> & _ "Network Library=dbnmpntw;"
> & _ "Initial Catalog=databaseexample;"
> & _ "User ID=webmasterofsite;"
> & _ "Password=4444;"
> set Con = server.CreateObject("adodb.Connection")
> con.open strCon

>  set rs = con.execute("update counter set HitCount = ((HitCount) + 1)
where
> ID = 1")

>  con.close
>  set rs = nothing
>  set con = nothing
> if Request.Cookies("publicregistered")="True" then
>  Response.Redirect("startSql.asp")
> end if

> Thanks

> Jonathan


 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Carl Prothma » Wed, 21 Aug 2002 00:23:36



Quote:> I am using a distant webhoster to run a classic asp program (not .net) which
> used to connect to an sql server database again which they hosted.
> A dsnless connection string similair to the following worked fine:
> strCon = "Provider=sqloledb;" & _ "Data Source=233.77.166.2;" & _ "Network
> Library=dbnmpntw;" & _ "Initial Catalog=databaseexample;" & _ "User
> ID=webmasterofsite;" & _ "Password=4444;"

Joanathan,
Assuming the remote SQL Server database is using "Mixed" security,
then make sure to specify the port number after the DataSource IP.
e.g.  "Data Source=xxx.xxx.xxx.xxx,1433;"
http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForSQLServerIP

Also, since the remote SQL Server is behind a firewall, then make your
ISP opens port 1433.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q269882

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Jonathan Blac » Wed, 21 Aug 2002 02:47:17


Hi Aron,

I forced named pipes because that was the only way I got the string to work
on sql 7 for some reason.

If I use Network=DBMSSOCN, then I get the following error page:

Provider error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.

/Default.asp, line 33

Jonathan

Quote:> strCon =

"Provider=SQLOLEDB;Server=233.77.166.2;Network=DBMSSOCN;Database=DatabaseExa
Quote:> mple;UID=webmasterOfSite;PWD=4444"

> Follow-ups trimmed.

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Jonathan Blac » Wed, 21 Aug 2002 02:52:11


Hi Curt,

If they switched to Windows Authentification then how come I can log in with
the same passwords and user names in Enterprise Manager or an MS Access adp
project?

It is only from the ado string in Asp I get the problem.
Doesn't this disprove your theory?

Thanks

Jonathan
...

> I'm guessing here but I'm betting they switched to Windows Authentication
> for their SQL Server and not "Mixed Mode". You may have to pass in a valid
> NT user account instead of a SQL user account.....
> Just a guess, but I'd ask them what authentication mode they are using for
> their SQL box.

> --
> ----------------------------------------------------------
> Curt Christianson (Software_AT_Darkfalz.Com)
> Owner/Lead Designer, DF-Software
> http://www.Darkfalz.com
> ---------------------------------------------------------
> ..Offering free scripts & code snippits for everyone...
> ---------------------------------------------------------



> > I am using a distant webhoster to run a classic asp program (not .net)
> which
> > used to connect to an sql server database again which they hosted.

> > A dsnless connection string similair to the following worked fine:

> > strCon = "Provider=sqloledb;" & _ "Data Source=233.77.166.2;" & _
"Network
> > Library=dbnmpntw;" & _ "Initial Catalog=databaseexample;" & _ "User
> > ID=webmasterofsite;" & _ "Password=4444;"

> > The strings details have been changed for security purposes but are
> similair
> > in type to the real string.

> > Now on the webhoster upgrading to sql server 2000 this connection string
> > stopped working.

> > However I can still connect using the same ip address and login details
> > through sql 2000 enterprise manager and through the access adp front
end.

> > The error message I now get through asp is:

> > Microsoft OLE DB Provider for SQL Server error '80004005'

> > [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access
> > denied.

> > Here is the full code for the connection routine:

> > strCon = "Provider=sqloledb;"
> > & _ "Data Source=233.77.166.2;"
> > & _ "Network Library=dbnmpntw;"
> > & _ "Initial Catalog=databaseexample;"
> > & _ "User ID=webmasterofsite;"
> > & _ "Password=4444;"
> > set Con = server.CreateObject("adodb.Connection")
> > con.open strCon

> >  set rs = con.execute("update counter set HitCount = ((HitCount) + 1)
> where
> > ID = 1")

> >  con.close
> >  set rs = nothing
> >  set con = nothing
> > if Request.Cookies("publicregistered")="True" then
> >  Response.Redirect("startSql.asp")
> > end if

> > Thanks

> > Jonathan

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Aaron Bertrand [MVP » Wed, 21 Aug 2002 01:52:14


Quote:> If I use Network=DBMSSOCN, then I get the following error page:

> Provider error '80040e21'

> Multiple-step OLE DB operation generated errors. Check each OLE DB status
> value, if available. No work was done.

This sounds like an error after the connection, so it looks like using my
connection string actually fixed your connection issue, and now you have an
error in one of your queries.

Also see http://www.aspfaq.com/2288

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Jonathan Blac » Wed, 21 Aug 2002 02:57:35


Hi Carl,

1) adding ,1433 did not help
2) port  1433 is open on the webhoster

Anyone have any other ideas?

Thanks

Jonathan

Quote:> Assuming the remote SQL Server database is using "Mixed" security,
> then make sure to specify the port number after the DataSource IP.
> e.g.  "Data Source=xxx.xxx.xxx.xxx,1433;"
> http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForSQLServerIP

> Also, since the remote SQL Server is behind a firewall, then make your
> ISP opens port 1433.
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q269882

> --

> Thanks,
> Carl Prothman
> Microsoft ASP.NET MVP
> http://www.able-consulting.com

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Jeff Dillo » Wed, 21 Aug 2002 02:00:41


Separate issue. Your new error is because you are trying to insert a string
that is too long for the underlying SQL datatype

Jeff


Quote:> Hi Aron,

> I forced named pipes because that was the only way I got the string to
work
> on sql 7 for some reason.

> If I use Network=DBMSSOCN, then I get the following error page:

> Provider error '80040e21'

> Multiple-step OLE DB operation generated errors. Check each OLE DB status
> value, if available. No work was done.

> /Default.asp, line 33

> Jonathan

> > strCon =

"Provider=SQLOLEDB;Server=233.77.166.2;Network=DBMSSOCN;Database=DatabaseExa

- Show quoted text -

Quote:> > mple;UID=webmasterOfSite;PWD=4444"

> > Follow-ups trimmed.

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Curt_ » Wed, 21 Aug 2002 02:05:39


did you try what Carl suggested about losing the Library= in the conn
string?

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------


> Hi Curt,

> If they switched to Windows Authentification then how come I can log in
with
> the same passwords and user names in Enterprise Manager or an MS Access
adp
> project?

> It is only from the ado string in Asp I get the problem.
> Doesn't this disprove your theory?

> Thanks

> Jonathan
> ...
> > I'm guessing here but I'm betting they switched to Windows
Authentication
> > for their SQL Server and not "Mixed Mode". You may have to pass in a
valid
> > NT user account instead of a SQL user account.....
> > Just a guess, but I'd ask them what authentication mode they are using
for
> > their SQL box.

> > --
> > ----------------------------------------------------------
> > Curt Christianson (Software_AT_Darkfalz.Com)
> > Owner/Lead Designer, DF-Software
> > http://www.Darkfalz.com
> > ---------------------------------------------------------
> > ..Offering free scripts & code snippits for everyone...
> > ---------------------------------------------------------



> > > I am using a distant webhoster to run a classic asp program (not .net)
> > which
> > > used to connect to an sql server database again which they hosted.

> > > A dsnless connection string similair to the following worked fine:

> > > strCon = "Provider=sqloledb;" & _ "Data Source=233.77.166.2;" & _
> "Network
> > > Library=dbnmpntw;" & _ "Initial Catalog=databaseexample;" & _ "User
> > > ID=webmasterofsite;" & _ "Password=4444;"

> > > The strings details have been changed for security purposes but are
> > similair
> > > in type to the real string.

> > > Now on the webhoster upgrading to sql server 2000 this connection
string
> > > stopped working.

> > > However I can still connect using the same ip address and login
details
> > > through sql 2000 enterprise manager and through the access adp front
> end.

> > > The error message I now get through asp is:

> > > Microsoft OLE DB Provider for SQL Server error '80004005'

> > > [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
> access
> > > denied.

> > > Here is the full code for the connection routine:

> > > strCon = "Provider=sqloledb;"
> > > & _ "Data Source=233.77.166.2;"
> > > & _ "Network Library=dbnmpntw;"
> > > & _ "Initial Catalog=databaseexample;"
> > > & _ "User ID=webmasterofsite;"
> > > & _ "Password=4444;"
> > > set Con = server.CreateObject("adodb.Connection")
> > > con.open strCon

> > >  set rs = con.execute("update counter set HitCount = ((HitCount) + 1)
> > where
> > > ID = 1")

> > >  con.close
> > >  set rs = nothing
> > >  set con = nothing
> > > if Request.Cookies("publicregistered")="True" then
> > >  Response.Redirect("startSql.asp")
> > > end if

> > > Thanks

> > > Jonathan

 
 
 

Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

Post by Carl Prothma » Wed, 21 Aug 2002 02:14:37



Quote:> 1) adding ,1433 did not help
> 2) port  1433 is open on the webhoster

> Anyone have any other ideas?

Other than Aaron's suggestion (use "Network Library=DBMSSOCN")
the only other thing I can think of is to open up the "SQL Server Client
Network Utility" and make sure TCP/IP is selected.

While you're in there you can always setup an Alias for your IP data source.
Again, make sure TCP/IP is selected and the port number is correct.

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com

 
 
 

1. Connecting to Sql Server from asp after upgrade from ms sql 7 to ms sql 2000

I am using a distant webhoster to run a classic asp program (not .net) which
used to connect to an sql server database again which they hosted.

A dsnless connection string similair to the following worked fine:

strCon = "Provider=sqloledb;" & _ "Data Source=233.77.166.2;" & _ "Network
Library=dbnmpntw;" & _ "Initial Catalog=databaseexample;" & _ "User
ID=webmasterofsite;" & _ "Password=4444;"

The strings details have been changed for security purposes but are similair
in type to the real string.

Now on the webhoster upgrading to sql server 2000 this connection string
stopped working.

However I can still connect using the same ip address and login details
through sql 2000 enterprise manager and through the access adp front end.

The error message I now get through asp is:

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.

Here is the full code for the connection routine:

strCon = "Provider=sqloledb;"
& _ "Data Source=233.77.166.2;"
& _ "Network Library=dbnmpntw;"
& _ "Initial Catalog=databaseexample;"
& _ "User ID=webmasterofsite;"
& _ "Password=4444;"
set Con = server.CreateObject("adodb.Connection")
con.open strCon

 set rs = con.execute("update counter set HitCount = ((HitCount) + 1) where
ID = 1")

 con.close
 set rs = nothing
 set con = nothing
if Request.Cookies("publicregistered")="True" then
 Response.Redirect("startSql.asp")
end if

Thanks

Jonathan

2. info-ingres mailing list

3. Arabic Issue on MS SQL Server 2000 after upgrading from SQL 6.5 / Access

4. Two Newbie Questions re: Check Boxes & Sort Order (ignoring specified words)

5. Problem with MS Access Runtime 95 AFter Upgrade to SQL Server 2000 (from SQL 7.0)

6. Report

7. ASP and MySQL vs ASP and MS SQL Server 2000

8. ingres II on hp-ux installation

9. Upgrade from MS SQL7 to MS SQL 2000

10. HOW TO UPGRADE FROM ACCESS 2000 TO MS SQL SERVER 7/2000 OR/MYSQL

11. Connecting to SQL 2000 server instance with MS Access 2000 (.ade file)

12. MS SQL 2000 vs MS SQL 7

13. MS SQL 2000 to MS SQL 6.5