Discussion Locked

SQL Server/ASP driven website

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How can I construct a data driven website using SQL Server and ASP? I know ASP and SQL, and I have seen a lot of sites that have query strings in the URL, such as the URL's below. What is this and how can I acheive it?

http://www.scient.com/pages/scient.asp?pagecref=147

http://www.scient.com/pages/Scient.asp?PagecRef=69&Mid=69

On that website, they seem to use one single page to control the rest of the data. How can I create websites that behave this way? And what is it called?

5 replies

by joseph moore

Ok. What you do is build an ODBC data connection on the web server, pointing to the SQL server database.
Then, in your ASP pages, you point to the ODBC connection, and use that as the device to connect to the dynamic content on the SQL server database.
So, if you can write ASP code, then you should know how to build the ODBC connection in the ASP. But here is a sample:

Conn = "Provider=SQLODBC;Persist Security Info=True;Initial Catalog=MYDATABASE;Data Source=192.168.1.1;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=192.168.1.1;Use Encryption for Data=False;Tag with column collation when possible=False;User Id=USERACCT;password=PASSWORD"

Now, that line would actually build the ODBC connection, instead of calling one that is already built on the web server. You can do it either way. If you don't want to build the ODBC connections on the web server, then you can just code it, like in my example. Either way works.

Then, you just have your ASP page pullfrom the SQL server to get its content. You can also pass parameters that way. That is what you are seeing in the URLs you posted. ASP parameters are being sent in the URL; the receiving ASP page will take the parameter passed, and process it, using it to generate more dynamic content.

hope this helps

by r. a. caluste

in your asp page, you put logical conditions such as

<% select case request.querystring("pagecref") %>
<% case 69 %>

<% end select %>

depending on the querystring value, the website
returns to the client browser the appropriate data.

btw, i saw your previous post and you rejected all good answers and closed the question. too bad for those who spent time trying to answer the question.

by rmg

The criteria is "Accetpable - helped me" and "Unacceptable - didn't help me" It's too bad that answers didn't help. Just because you spend time answering a question, doesn't mean you get points for effort. Remember that.

This discussion is closed to new replies.