If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Microsoft OLE DB Provider for SQL Server error '80040e4d' Invalid connection string

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-13-08, 00:55
Abdeali Abdeali is offline
Registered User
 
Join Date: Feb 2008
Posts: 4
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.
Reply With Quote
  #2 (permalink)  
Old 02-13-08, 03:31
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 02-13-08, 03:39
Abdeali Abdeali is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 02-13-08, 04:00
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 02-13-08, 04:44
Abdeali Abdeali is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 02-13-08, 05:41
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #7 (permalink)  
Old 02-13-08, 06:01
Abdeali Abdeali is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 02-13-08, 07:38
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On