Classic ASP ConnectionString?
-
Hi Guys, I know that this is an ASP.Net forum, but just in case some of you still remember about the classic ASP, I have one question. How can I assigned connection in Classic ASP using the MSSQLServer 2005? I tried this code below, but I got an error. Below is the connection string I have tried, but has an error Application("ConnStr") = "server=PC\SQLEXPRESS;database=TestDB;Trusted_Connection=True;" What's wrong with it?
hifiger2004
-
Hi Guys, I know that this is an ASP.Net forum, but just in case some of you still remember about the classic ASP, I have one question. How can I assigned connection in Classic ASP using the MSSQLServer 2005? I tried this code below, but I got an error. Below is the connection string I have tried, but has an error Application("ConnStr") = "server=PC\SQLEXPRESS;database=TestDB;Trusted_Connection=True;" What's wrong with it?
hifiger2004
hifiger2004 wrote:
I know that this is an ASP.Net forum, but just in case some of you still remember about the classic ASP,
I guess Web Development Forum is the best location where you can ask this. For you ref. You can check following links. that may help you : [^] and http://forums.digitalpoint.com/showthread.php?t=154140[^] and http://www.devarticles.com/c/a/ASP/Two-Ways-To-Connect-To-SQL-Server-2000-Via-ASP/3/[^]
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Hi Guys, I know that this is an ASP.Net forum, but just in case some of you still remember about the classic ASP, I have one question. How can I assigned connection in Classic ASP using the MSSQLServer 2005? I tried this code below, but I got an error. Below is the connection string I have tried, but has an error Application("ConnStr") = "server=PC\SQLEXPRESS;database=TestDB;Trusted_Connection=True;" What's wrong with it?
hifiger2004
I guess ASP uses class ADO for data base connection .You need t provide provider information
Provider=SQLNCLI10;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;
-
Hi Guys, I know that this is an ASP.Net forum, but just in case some of you still remember about the classic ASP, I have one question. How can I assigned connection in Classic ASP using the MSSQLServer 2005? I tried this code below, but I got an error. Below is the connection string I have tried, but has an error Application("ConnStr") = "server=PC\SQLEXPRESS;database=TestDB;Trusted_Connection=True;" What's wrong with it?
hifiger2004
hifiger2004 wrote:
What's wrong with it?
Everything :) Google for ado, check connectionstrings.com for connection details
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
-
hifiger2004 wrote:
What's wrong with it?
Everything :) Google for ado, check connectionstrings.com for connection details
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
still doesn't work :( In ASP.Net there's no problem when using this type of connection string inside the web.config <add name="ConnStr" connectionString="Data Source=PCName\SQLEXPRESS; Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient" /> I tried the codes below and placed it inside the global.asa but still doesn't work. Error: An unhandled exception ('[Microsoft][ODBC Driver Manager] Dta source name not found and no default driver specified') occurred in dllhost.exe [1368]. ConnStr = "Driver={SQL Server};Data Source=PCName\SQLEXPRESS;Initial Catalog=MyDatabase;Trusted_Connection=Yes;" Or ConnStr = "Provider=SQLOLEDB; Data Source =PCName\SQLEXPRESS; Initial Catalog = MyDatabase;Integrated Security=SSPI;" It's really time consuming, I followed everything you told me from connectionstrings.com but still doesn't work at all.
hifiger2004
-
still doesn't work :( In ASP.Net there's no problem when using this type of connection string inside the web.config <add name="ConnStr" connectionString="Data Source=PCName\SQLEXPRESS; Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient" /> I tried the codes below and placed it inside the global.asa but still doesn't work. Error: An unhandled exception ('[Microsoft][ODBC Driver Manager] Dta source name not found and no default driver specified') occurred in dllhost.exe [1368]. ConnStr = "Driver={SQL Server};Data Source=PCName\SQLEXPRESS;Initial Catalog=MyDatabase;Trusted_Connection=Yes;" Or ConnStr = "Provider=SQLOLEDB; Data Source =PCName\SQLEXPRESS; Initial Catalog = MyDatabase;Integrated Security=SSPI;" It's really time consuming, I followed everything you told me from connectionstrings.com but still doesn't work at all.
hifiger2004
hifiger2004 wrote:
In ASP.Net there's no problem when using this type of connection string inside the web.config
But you are using CLASSIC ASP you said. It knows nothing about web.config, global.asa etc, these are .NET only. You need to use ADO NOT ADO.NET, create connection objects and so on. Take a look at this: http://support.microsoft.com/kb/299980[^]
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP