I have 2 IIS Virtual Directories called MyTest1 and MyTest2. Each virtual
directory has a ASP.NET file called "test.aspx" which using ADO 2.6
(not ADO.NET) to populate its combo-box on the Page_Load event.
(see the code below)
The problem is if I execute "test.aspx" on the first virtual directory
http://mgmtsys16/MyTest1/Test.aspx, then I can NOT execute "test.aspx" on
the second virtual directory, http://mgmtsys16/MyTest2/Test.aspx.
After debugging for few hours, I found out that when I call "test.aspx" on
virtual directory after calling "test.aspx" on the first virtual directory
first, its recordset
does NOT have "Fields" object. However, I can still loop on its recordset.
My conclusion, we can not have 2 virtual directories on the same computer
ADO 2.6 using ASP.NET and VB.NET. But it is okay to have 2 aspx files
ADO 2.6 on the same virtual directory. Is it a bug or just setting matter?
/************* Sample Code ***************/
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim strConnection As String = "provider=SQLOLEDB; server=mgmtsys16;
Dim dbConnection As ADODB.Connection
Dim rstData As ADODB.Recordset
Dim strResult As New ArrayList()
Dim strSQL As String
'Create DB Connection
dbConnection = New ADODB.Connection()
strSQL = "select groupName from tblTypes where objectType =
'objectSchema' ORDER BY groupName"
rstData = dbConnection.Execute(strSQL)
Do While Not rstData.EOF
strResult.Add("" & rstData.Fields("groupName").Value)
Catch exc As Exception
If Not dbConnection Is Nothing Then
If dbConnection.State =
ADODB.ObjectSta*um.adStateConnecting Then dbConnection.Close()
dbConnection = Nothing
Me.cboDataObject.DataSource = strResult