Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2008
    Posts
    4

    Unanswered: Microsoft OLE DB Provider for SQL Server error '80040e4d' Invalid connection string

    Hi,

    On clicking a link which redirects to page called Reports.asp i am getting the following error :

    Microsoft OLE DB Provider for SQL Server error '80040e4d'
    Invalid connection string

    The connectionstring has been declared in an application variable called Application(connectionString) = <The Connection String> in global.asa file.
    This application variable has been declared in Reports.asp page.

    This is working fine on my machine i.e localhost but client is getting the above error.The global.asa contents of client are as given below:

    Application("DBConnectString")

    = "Provider=SQLOLEDB; Data Source=med2; Initial Catalog=rxbrid; User ID=rxbrid;Password=rxbride;"

    Application("LoginPage")
    = "http://rxbridgepa3.medbankmd.org/Login/Login.asp"
    Application("ErrorPage")
    = "../Include/Error.asp"
    Application("PatientSearch")
    = "../Patient/PatientSearch.asp"
    Application("MessageCentralSearch")= "../MessageCentral/MessageCentralSearch.asp"
    Application("BaseURL")
    = "http://rxbridgepa3.medbankmd.org/"
    Application("SessionInactiveTime") = 60
    Application("Logout")
    = "http://rxbridgepa3.medbankmd.org/Include/Logout.asp"
    Application("ServerName")
    ="med2"
    Application ("DBUserName")
    ="rxbrid"
    Application("DBPassword")
    ="rxbride"
    Application("DBName")
    ="rxbrid"

    I am unable to figure out what is missing on the client's end.Is it some problem of the difference of OS?I am unaware of the OS they are using.But the softwares they are using are similar to ours.

    Any help shall be highly appreciated.Thanks in advance

    Abdeali.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    Data Source=med2;
    That bit looks wrong to me...
    That should be the server address?

    I assume you're trying to connect to a MSSQL2005 database?
    www.connectionstrings.com
    George
    Home | Blog

  3. #3
    Join Date
    Feb 2008
    Posts
    4
    Thanks for your reply george.

    Data Source=med2; is the name of the server they are connecting to.Do you mean that an ip address should be given instead of the server name?

    If the data source address is not correct then why i am getting error on clicking the link of Reports.asp page and not on the link of other pages?

    I am trying to connect to MSSQL2000 database.

    bye.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Ahh, so the same connection string is working for many pages just not this one..?

    If so, please post the relevant connection code for reports.asp
    George
    Home | Blog

  5. #5
    Join Date
    Feb 2008
    Posts
    4
    Yes,the same connectionstring is used for all the pages.

    Application("DBConnectString")

    = "Provider=SQLOLEDB; Data Source=med2; Initial Catalog=rxbrid; User ID=rxbrid;Password=rxbride;"

    This application variable Application("DBConnectString") is used in Reports.asp page.The following is the code for connection establishment:

    strConnectString = Application("DBConnectString")
    '------------------------------------------------------------------------------------
    'Database connection for dynamic SQL's

    Set objConnection = Server.CreateObject("ADODB.Connection")
    Set objRecordset = Server.CreateObject("ADODB.Recordset")
    objConnection.ConnectionTimeout = 15
    objConnection.CommandTimeout = 30
    objConnection.Provider = "sqloledb"
    objConnection.Open strConnectString 'this is the line where it is throwing error

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Do me a favour and try it with a hard coded connection string for a minute
    Code:
    objConnection.Open("Provider=SQLOLEDB; Data Source=med2; Initial Catalog=rxbrid; User ID=rxbrid;Password=rxbride;")
    George
    Home | Blog

  7. #7
    Join Date
    Feb 2008
    Posts
    4
    Thanks George for your efforts.

    I cannot try this code as it is at client side they are getting error and not at my side.

    The client provided their code and we implemented on our system using that code and its working fine.But using same code they are getting error....This is what i cant make out.

    May be the below URL may make the matter clear....

    http://rxbridgepa3.medbankmd.org/Login/Login.asp

    Login by using following details :

    user.. rmcewanpa3

    pw.. rmcewanpa3


    Click on "Reports" link upwards and the error will be displayed.

    Can you please try it out?

    Thanks.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    The error isn't quite how you posted originally
    Code:
    Microsoft OLE DB Provider for SQL Server error '80040e4d' 
    
    Invalid connection string attribute 
    
    /Reports/Reports.asp, line 48
    Can you confirm what is on line 48; I assume it is this
    Code:
    objConnection.Open strConnectString 'this is the line where it is throwing error
    But would just like you to double check

    I notice that you've not used parenthesis with the Open command; can you try it with these? i.e.
    Code:
    Response.Write(strConnectString)
    objConnection.Open(strConnectString)
    I have added a response.write command; can you post the results of this too please?
    George
    Home | Blog

Posting Permissions

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