I've taken over webdevelopment (intranet) for a company, but I have very little formal asp/sql experience. I've been doing fine just editing/copying/pasting existing code, but I have some questions and I'm not sure where to find the answers.
Every asp page has an include at the top with the code:Then at the bottom of every page theres an include with:Code:<% dim conn set conn=server.createobject("ADODB.Connection") conn.open "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\Inetpub\wwwroot\fpdb\workor~1.mdb;" %>So when I want to make a connection I just do:Code:<% if isobject(conn) then conn.close set conn=Nothing else end if %>But when I look up code on websites it never really looks like mine. Is the way I'm doing it alright? I mean it works but I have no clue if that's how it should be done.Code:<% dim gld gld=conn.execute("SELECT field FROM table WHERE this='that'") %> Field: <%=gld("field")%> <%set gld=Nothing%>
Also, is it necessary to do <%set var=Nothing%> whenever I'm done with a variable? If I leave it open is that bad? Will the bottom include close them all for me?
Let me know if this doesn't make much sense. I just wanna make sure I'm not making any huge mistakes here.




Bookmarks