Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Major mixup in two ASP.NET transactions
Message
From
28/09/2006 12:44:29
 
 
To
28/09/2006 11:01:11
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01150471
Message ID:
01157900
Views:
54
>>If oCommand is scoped to the hit (and only referenced within that scope) then the parameter collection should be clean. But what's the scope of oParameters2 and how is it populated?
>
>oParameters is private to the class and populated as follow:
>
>
>        Private oParameters As New ArrayList
>        Private oParameters2 As New Collection
>
>
>Each parameter is added by using this method into oParameters. Then,
>
>
>        ' Add a parameter
>        ' expC1 Field
>        ' expO1 Value
>        Public Function ParameterAdd(ByVal tcField As String, ByVal toValue As Object) As Boolean
>            Dim loParameter(1, 2) As Object
>            loParameter(1, 1) = tcField
>            loParameter(1, 2) = toValue
>            oParameters.Add(loParameter)
>        End Function
>
>
>Then, before each SQL method from the class, this method is called to set the proper type of connection, dataadapter, command and parameters. This is where oParameters2 is then initialized accordingly to the type of connection string used.
>
>
>        Private Function InitializeDataObject(ByVal tcConnection As String, ByVal tcSql As String) As IDbConnection
>            Dim loEnumerator As IEnumerator = oParameters.GetEnumerator
>            Dim loParameter As Object
>            cConnectionString = tcConnection
>            cSQL = tcSql
>            oParameters2.Clear()
>            Select Case nSQLMode
>                Case 1
>                    oConnection = New OleDbConnection(tcConnection)
>                    oDataAdapter = New OleDbDataAdapter
>                    oCommand = New OleDbCommand
>                    While loEnumerator.MoveNext
>                        loParameter = loEnumerator.Current
>                        oDataParameter = New OleDbParameter("@" + loParameter(1, 1).ToString, loParameter(1, 2))
>                        oParameters2.Add(oDataParameter)
>                    End While
>                Case 2
>                    oConnection = New SqlConnection(tcConnection)
>
>

If the code is all in the same class, the class is instantiated on a per hit basis, and the only reference to it is at the page level then there shouldn't be a problem.

>>Where did the "Variable 'ADDDATE' is not found" message come from - .NET or VFP?
>
>The backend is VFP.
But did the message originate from the VFPOLEDB?
The fact that it was expecting a 'ADDDATE' variable should provide a clue - presumably such a variable or column name is used in the App.

Just a thought: if you change the namespace for your page based classes you might be able to discover where they're used/referenced by the global class/classes from the resulting compile errors.....

Can't think of much else to suggest - essentially the interaction between your application object and the hit instantiated object (oProcess?) should be limited to the reading of oApp properties by oProcess. Anything else should be viewed the suspicion.....

Best,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform