Forum Moderators: open
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/sql.asp" -->
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_sql_STRING
Recordset1.Source = "SELECT c.cat_name FROM type t, category c, cats_to_types ctt WHERE t.type_name LIKE 'Food' AND t.type_id = ctt.type_id AND ctt.cat_id = c.cat_id "
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
set selecttype = Server.CreateObject("ADODB.Recordset")
selecttype.ActiveConnection = MM_sql_STRING
selecttype.Source = "SELECT t.type_name FROM type as t "
selecttype.CursorType = 0
selecttype.CursorLocation = 2
selecttype.LockType = 3
selecttype.Open()
selecttype_numRows = 0
%>
Is there a more efficient way of doing this, and is all the code needed.
thanks
or you can just build them in design view, it is very easy once you get the hang of it, the access help gives some examples of what to do.
the idea is to build the query directly into the database so the database engine does the sorting rather than the server, you need to include all the parameters that you are using on the page but no others, thats the point of it.
in ultradev when you create the recordset chose the access query from the dropdown list of Tables, you still will need to do the WHERE statements as before.
this just gives you cleaner code, it also puts less pressure on the server, additionally if you are working with tables with complicated joins, the SQL statements on the page begin to get really long and complex, but if you built the query into the db its a snap.
regarding this section of code ... yes you need it all
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
The Insert, Update, and Delete routines in DWU are especially bloated.
Essentially, an update statement looks like this:
update table set field = new value where field = XXX.
The code from Dreamweaver is so bloated. I usually yank it out and write my own.
The select statements are not as bad.
Is it any book that explains how MS access can be used for development of SQL databases??
Alex