Guest_imported
New member
- Jan 1, 1970
- 0
OK here is what i am trying to do i have all of these calls to different database tables in my document and esentialy the only difference in any of them is the name and the select string. So i figure why waste space with all this repeated junk. So i right this function:
<%
Function startDBQuery(query)
set dbQuery = Server.CreateObject("ADODB.Recordset"
dbQuery.ActiveConnection = MM_Conference_STRING
dbQuery.Source = query
dbQuery.CursorType = 0
dbQuery.CursorLocation = 2
dbQuery.LockType = 3
dbQuery.Open()
dbQuery_numRows = 0
startDBQuery=dbQuery
end function
%>
and import it into the document. problem well it does not like me doing it this way. It seems to be having a problem assigning the returned value to a pointer when it is done. or at the very least keeping it pointed at the same thing. Is this a pointer problem i am having or does it just not like me trying to assign things this way og by the way this is that statement i would use to assign this function return to a pointer:
set AttendeeMX = startDBQuery("SELECT max(AttendeeID) as MaxID FROM Attendees"
i get an error when i try to close the link. Any ideas as to what's going on here and whether or not this is even posible would be apreciatd
thanks
andrew
<%
Function startDBQuery(query)
set dbQuery = Server.CreateObject("ADODB.Recordset"
dbQuery.ActiveConnection = MM_Conference_STRING
dbQuery.Source = query
dbQuery.CursorType = 0
dbQuery.CursorLocation = 2
dbQuery.LockType = 3
dbQuery.Open()
dbQuery_numRows = 0
startDBQuery=dbQuery
end function
%>
and import it into the document. problem well it does not like me doing it this way. It seems to be having a problem assigning the returned value to a pointer when it is done. or at the very least keeping it pointed at the same thing. Is this a pointer problem i am having or does it just not like me trying to assign things this way og by the way this is that statement i would use to assign this function return to a pointer:
set AttendeeMX = startDBQuery("SELECT max(AttendeeID) as MaxID FROM Attendees"
i get an error when i try to close the link. Any ideas as to what's going on here and whether or not this is even posible would be apreciatd
thanks
andrew