Discussion Locked

Programming with a SQL database

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am helping a friend design a website with a SQL database embedded into it. We want the site to be auto-updating and are trying to figure out what programming language to use to build the scripts to interact with the database.

3 replies

by aking-robertson

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.

This discussion is closed to new replies.