#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2005
    Posts
    82
    Rep Power
    10

    Microsoft OLE DB Provider for SQL Server error '80004005'


    Hello.
    I am getting this error

    Microsoft OLE DB Provider for SQL Server error '80004005'

    [DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection

    The truth is...i have never saw this error before. I just understand a little bit what it means...
    I someone understand,please help me

    Well...my there's my code...and the line that points the error is in bold.
    Thank u all.
    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <%
    <!-- #include file="adovbs.inc" -->
    caminho=left(Server.mappath(Request.ServerVariables("PATH_INFO")),InstrRev(Server.mappath(Request.ServerVariables("PATH_INFO")),"\"))
    Const ForReading = 1
    ' our variables
    Dim objFSO , objTextStream , strText , strFileName , iSalesObj , strConn
    Set iSalesObj=Server.CreateObject("ADODB.Connection")
    strConn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=abc;pwd=xyz;Initial Catalog=iSales;Data Source=("&caminho&")"
    iSalesObj.open strConn'Line with error
    'Path to our text file
    strFileName = Server.MapPath("arquivo.txt")
    'create an instance of the FileSystemObject
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    'open our text file
    Set objTextStream = objFSO.OpenTextFile(strFileName , ForReading , False)
    If not objTextStream.AtEndOfStream Then
    Do While not objTextStream.AtEndOfStream
    	'read in our text one line at a time and display it
    	strText = objTextStream.ReadLine
    	strText = Replace(strText,"'","''")'--Replace single quote with two single quotes
    	FVals = Split( strText,";" ) '---Split the value using comma. If text file delimeted by ; then instead of comma use ;
    	Cod = Fvals(0)
    	strSQL = "SELECT * from tabela where cod='"&Cod&"'"
    	set RS = Server.CreateObject("ADODB.Recordset")
    	RS.LockType = adLockOptimistic	
    	RS.Open strSQL, iSalesObj, , , adCmdText
    	if Not RS.EOF then
    		RS("compra") = RS("compra")+Fvals(4)
    		RS.Update
    	else
    		RS.AddNew
    		RS("cod") = Fvals(0)
    		RS("nome") =Fvals(1)
    		RS("telefone") =Fvals(2)
    		RS("email") =Fvals(3)
    		RS("compra") =Fvals(3)
            	             '...Continue for all the other values
    		RS.Update
    	End if
    	RS.Close
    	Set RS = Nothing
    Loop
    End If
    objTextStream.Close
    'good practice to setobject variables to nothing
    Set objFSO = Nothing
    Set objTextStream = Nothing 
    %>
  2. #2
  3. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2005
    Location
    Moscow, Russia
    Posts
    327
    Rep Power
    22
    Wrong connection string for SQL server.
    http://www.connectionstrings.com/
    Data Source=server_name_or_ip_address[\instance_name] or Data Source=(local)
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2005
    Posts
    82
    Rep Power
    10
    Take a look in my caminho
    it returns the path...exactly
    and if i use data source = local , i got the same error

    Thanks.
    ....Edited...

    I changed the connection string two times,and two times got an error
    the first one,was local...the error was:

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

    then, to my domain...look
    Code:
    strConn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=abc;pwd=xyz;Initial Catalog=iSales;Data Source=(foxproducoes.com.br\wwwroot\pablo
    Even local , or with it,or with the ip address , or inserting my filename...i get error.
  6. #4
  7. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2005
    Location
    Moscow, Russia
    Posts
    327
    Rep Power
    22
    foxproducoes.com.br\wwwroot\pablo
    The SQL server is a SERVER, not a FILE (like Access).
    For remote server:
    1.You should use TCP/IP instead of named pipes. http://support.microsoft.com/kb/q238949/
    2. You should have an abilty to connect to remote server to port 1433 (or another, if non-standard port is used). Check the firewalls, etc. telnet IP_address 1433 should connect.
    3. For named instance of a SQL server you should indicate it's name in a query string.
  8. #5
  9. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2005
    Posts
    82
    Rep Power
    10
    Oh man
    I can't connect at port 1433...what should i do
    and look how my code actually is...
    now it is right(the connection string) ?

    Code:
    Dim objFSO , objTextStream , strText , strFileName , iSalesObj , strConn
    Set iSalesObj=Server.CreateObject("ADODB.Connection")
    strConn = "Provider=MSDASQL.1;Persist Security Info=False;User ID=abc;Extended Properties="DSN=<arquivo.txt>;UID=<User ID>;DATABASE=pubs;Network Library=dbmssocn";Initial Catalog=pubs"
  10. #6
  11. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2005
    Location
    Moscow, Russia
    Posts
    327
    Rep Power
    22
    Try:
    Code:
    "Provider=sqloledb;Data Source=IP_address;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=abc;Password=asdasd;"
    I can't connect at port 1433
    Sounds like you have a network problem...
    ping IP_address - ?
  12. #7
  13. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Sep 2005
    Location
    Manassas, VA
    Posts
    328
    Rep Power
    10
    Originally Posted by Dwarf
    Try:
    Code:
    "Provider=sqloledb;Data Source=IP_address;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=abc;Password=asdasd;"

    Sounds like you have a network problem...
    ping IP_address - ?
    The port is not open on your firewall. Ask the network admin to open the port for you and it should work. This is something the network admin has to do unless you have access to the firewall. As a default it is not open.
  14. #8
  15. Senior Fire Wizard
    ASP Mastermind (5000+ posts)

    Join Date
    Feb 2005
    Location
    Ashford, Kent. England
    Posts
    5,651
    Rep Power
    314
    Or it may be that SQL Server is listening on a non standard port, again
    you will need to talk to the Admin to find out.

Similar Threads

  1. Microsoft SQL Server Tips
    By Memnoch in forum Microsoft SQL Server
    Replies: 9
    Last Post: February 8th, 2012, 11:18 PM
  2. Replies: 1
    Last Post: November 9th, 2004, 08:17 PM
  3. Replies: 12
    Last Post: August 4th, 2004, 12:10 PM
  4. Microsoft OLE DB Provider for SQL Server error '80040e21'
    By mojito in forum Microsoft SQL Server
    Replies: 0
    Last Post: July 28th, 2004, 03:35 AM
  5. Web serverístatistical analysis
    By cso in forum ASP Development
    Replies: 0
    Last Post: April 19th, 2003, 11:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo