Hi Everybody,
I've been studying ASP from books and by looking at open source code available on the net. One of the things I've discovered is that some of the open source code I've been looking at doesn't look much like what my ASP book has in it. For Example, My Wrox Beginning ASP 3 book has something like this in it for data store access.
<%
Dim objConn, objRS
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
adOpenForwardOnly=0
adLockReadOnly=1
adCmdTable=2
Set objConn=Server.CreateObject("ADODB.Connection")
Set objRS=Server.CreateObject("ADODB.RecordSet")
objConn.Open strConnect
objRS.Open "Movies", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable
(more code, yada yada yada...)
%>
However, I've seen open source code with something like this:
<%
Dim objConn, objRS, strConnect, strSQL
strConnect = "connection yada yada yada; Persist Security Info=false"
strSQL="SELECT * FROM tblTABLE ORDER BY table_id"
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
Set objRS=objConn.Execute (strSQL)
(more code, yada yada yada...)
%>
I'm much more comfortable with the second example. Is there any value in doing things like the first example from my ASP book? Do people actually code like that or is it something you only see in a textbook? I'd appreciate any opinions you could provide.
Thanks,
Ken
===============
The greatest tragedy is a child without a loving parent.