New job and brand new works is giving me new things to learn. Currently I am staying with ASP again! This time it is not ASP.net but ASP classic.
So to begin the topic, I would like to say that I have been working with .NET and SQL Server for long and living my life with it. Also, I have to say that those all are still not enough!
Just now I faced a problem with connection string to a database server running in SQL Server 2005. To add the problem, I connect from ASP classic. This means I have a little of technological advantages. I have just realize that all these times I was working with the help of tools and free scattering libraries. I also have been working using a lot of auto generated connection to database. Using all new features really made myself dull.
The problem I met is that generating the connection string to server is not as easy as it seems. It is so different when you use a wizard and when you type it up in your config or global.asa or global.asax. Using tools often all you have to do is click here and there, install package this and that. Then, voila! The connection is automatically generated in your app.config or in web.config.
When using ASP classic, you have to carefully select the connection provider. This is also a bit hard since you might not have the correct provider or driver. All help seemed to give you no result.
Connection provider is also crucial for if you pick the wrong one, you might have to check the data source. Not all provider allow to use comma in the data source. Defining an alias in your development PC would be useful.
After you finished making the correct connection string, you also have to test out the connection string you have passed using session. The test is not like connection then ok. But you have to test it on each page. I encounter a problem where page A and page B, return a different connection string which were called from the same session object. Let’s call the object Session(“ABC”). Page A returns the same as the connection I define in global.asa. While page B returns the connection string without the credentials. Well, this can be solved by you calling the connection string from a config instead of passing it in session.
In the end, all it takes is more and more experiment to know new things like this.