|
You can save that into an asp file, and use an include statement to refer to the file - sharing it across your whole app, being able to make changes to one file that automatically affect all the others. You're using ASP Classic, and I use ASP.NET, so I can't tell you the exact syntax, but I think it's just <% include file="somefile.asp" %> ... if not, it's very close, and MSDN can show you the exact syntax.
Another note is it looks like you used the ODBC manager in the Control Panel ( or under Admin Tools depending on the O/S ) to store the info needed to get to the database, and are referring to that file. You might want to think about just using a connection string instead. Say you want to move your application to another web site, or just another server. Now it's not only the code that needs to be moved.
It looks like you're probably either talking to SQL Server or MySql; you can just create a string that says:
adoConn.Open "Server=localhost; Database=myDB; UID=; PWD=;"
Then, when you move your application, the way to get to the database is part of your code, and it's that much simpler.
|