Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 sql connection string read only

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2015-04-22 : 13:49:35
I set up on sql a Read-Only Routing for an Availability Group

Now I need to connect from my asp script using read only
it works from sql management studio but i can't get the conection in asp

can anyone advise a working connection string?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-22 : 13:59:07
Show us your connection string. Is the app using database drivers that support it? Which database driver and which version?

ApplicationIntent=ReadOnly

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2015-04-23 : 00:21:26
what's not working is

strconview="Provider=sqlncli11;Server=1.2.3.4.5;Database=p;Uid=p;Pwd=abc;ApplicationIntent=ReadOnly"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-23 : 13:33:21
You need to determine if the database driver in use supports it. Which one are you using and which version?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2015-04-24 : 01:35:24
How can I know that

I'm trying access this from asp classic

MY connection string is above
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-24 : 13:35:57
Maybe this helps: http://blogs.msdn.com/b/alwaysonpro/archive/2013/08/02/connect-to-sql-server-using-application-intent-read-only.aspx

Of note though, sqlncli11 is OLEDB and doesn't support the multi-subnet failover option. Not sure if you have a multi-subnet AG configuration.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -