When accessing the visit property in 'Sub RenderSelect'
'Set Query = Visit.oOrder.GetAllDepartments()' the
visit function is called. On return from the visit
function I have an obejct reference to both Visit and oOrder.
(At least InterDev debugger says I do)
Then the code calls Visit.oOrder.GetAllDepartments.
This method creates and returns an ADO RS with department names
This method call works in VB and VFP.
This method call hangs in IIS
HTML tags have no arrows since UT does not allow. Also double quotes
were removed
' Globally define certain site metrics, such as its name and domain
const g_sitename = sitename
const g_domainname = domain.com
const g_appdir = \directory
const Select_Departments = 0
' g_bodytag is used to set elements of the style sheet that don't work
' 100% in all browsers.
const g_bodytag = _
bgcolor=#ffffff leftmargin=0 topmargin=0 marginleft=0 margintop=0
' Create somewhere to hold the Visit object as we process the page...
DIM m_visit
Function visit
' Visit - this function returns an instance of the Visit back to the caller.
' If one does'nt exist, it will create one...
' Do we have one?
IF IsEmpty(m_visit) Then
' Create an instance of the Visit object...
Set m_visit = Server.CreateObject("appname.visit")
' The visit object was built in VFP. We need to send this information
' to it so that we can enjoy its use without errors.
m_visit.configure g_sitename, g_domainname, driver=SQL Server; & _
INITIAL CATALOG=catalogname;UID=userid;PWD=password; & _
SERVER=servername", g_appdir
END IF
' Return the Visit object back
SET visit = m_visit
End Function
Sub RenderSelect(TableID, TagName)
' Start the select statement
Response.Write select name= & TagName &
' Set a default (Select) option to prompt the user to select one...
Response.Write option value=(Select) option
' Select the items from the db...
DIM query, IDColumn, NameColumn, oOrder
SELECT CASE TableID
' Select out departments
CASE Select_Departments
Set Query = Visit.oOrder.GetAllDepartments()
IDColumn = DepartmentID
NameColumn = Name
END SELECT
' Loop them all
DO WHILE NOT Query.EOF
' Draw it... (check to see it it's selected too)
Response.Write option.value= & query(IDColumn) &
IF CSTR(query(IDColumn)) = CSTR(Request(tagName)) then
Response.Write " selected"
END IF
Response.Write
Response.Write Query(NameColumn)
Response.Write /option
' Loop to next
query.movenext
LOOP
' End the select statement
Response.Write Select
END SUB
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net
If at first you don't succeed, then skydiving definitely isn't for you.