www.webdeveloper.com
Results 1 to 3 of 3

Thread: Cannot connect to DB with asp classic and connection string

  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Cannot connect to DB with asp classic and connection string

    Hey folks, I have a connection string in asp and a asp page which is connected to that connection string asp page, but I got a big problem :

    Microsoft OLE DB Provider for SQL Server error '80004005'

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

    /en/tope_results.asp, line 31

    this error happen when my asp page is try to connect to DB using my connection string file .

    admin_sea_tracker.asp (connection string file)

    Code:
    <%
    
    Dim MM_admin_sea_STRING
    
    MM_admin_sea_STRING = "Provider=SQLOLEDB.1;Password=***;Persist Security Info=True;User ID=***;Initial Catalog=***;Data Source=94.184.243.170;"
    
    %>
    tope_results.asp (Result file which use above connection for connecting to DB)

    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!--#include virtual="/Connections/admin_sea_tracker.asp" -->
    
    <%
    Dim rs_products
    Dim rs_products_cmd
    Dim rs_products_numRows
    
    Set rs_products_cmd = Server.CreateObject ("ADODB.Command")
    
    
    
    rs_products_cmd.ActiveConnection = MM_admin_sea_STRING ===> (Line31)
    
    
    
    
    rs_products_cmd.CommandText = "SELECT * FROM dbo.VSite WHERE FileNo = ?" 
    
    rs_products_cmd.Prepared = true
    
    rs_products_cmd.Parameters.Append rs_products_cmd.CreateParameter("param1", 5, 1, -1, rs_products__MMColParam1) ' adDouble
    
    Set rs_products = rs_products_cmd.Execute
    rs_products_numRows = 0
    %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>:: Search Result ::</title>
    Our db is SQL Server 2000. Admin give me user password that only I can access to one certain view in whole DB, I test my connection string in some connection string tester program (shown in attachment) and it said that connection managed to connect to Db successfully but I don't know where is the problem that I can't use that connection string file in my .asp pages, I just need to connect to DB by that connection string then my problem is solved, please give me some solutions.

    If you want to test the application please go to thins link and choose a radio button then enter something in shipment tracking text box (its above news frame) then click go and you'll see the error)

    Thank you very much folks.
    Attached Images Attached Images
    • File Type: gif 1.gif (21.0 KB, 146 views)
    • File Type: gif 2.gif (10.7 KB, 132 views)

  2. #2
    Join Date
    Mar 2011
    Posts
    4
    I can connect with management studio with that user pass but yet I have my problem that I posted above, Please give me a hand folks.
    Last edited by datis; 04-26-2011 at 11:05 AM.

  3. #3
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Hi,

    sounds like a firewall issue maybe, have you tried turning of your firewall to see if that is the issue?

    The is saying it cant see any SQL server. You know your username and password is correct becuase the utility can connect. Only thing i would think is the program you installed for checking your connections is getting through your firewall but sql server is not. Check you have allowed access to the correct ports.



    regards

    Ribs

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles