Web Development
3 replies
I create web pages that perform assorted database functions with an SQL Server database everyday in my job. The tools I use consist of writing asp pages that use vbscript that generally call components that have been written in visual basic. The components are usually what I use to perform the updates/inserts/deletes to the database. If you aren't familiar with calling components in VB from an asp page, it goes like this:
<% set variable = Server.CreateObject("ProjectName.ClassName")
variable.RoutineName
set variable = nothing %>
where the variable is simply a variable.
"ProjectName" is the name of the dll you create in VB; "ClassName" is the name of the class in the dll and the "RoutineName" is simply the subroutine you define in the class in the dll. I know all of this sounds confusing.
You can also access a SQL Server database within the asp page using VB Script. You just need to declare and set some variables to be activeX variables. For example:
set cn = server.createobject("ADODB.Connection")
set rs = server.createobject("ADODB.Recordset")
Then you would need to give the properties of the connection and open the recordset. I prefer the first method however, because since the VB project will be a compiled .dll, it will run much faster and more efficiently than vbscript. Hope this helps. Good luck.
by neoblade
by neoblade
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending