database connection

ym21

Member
Joined
May 19, 2005
Messages
10
hi all
i am newbies in asp .net
i am trying to connect sql server 2k database
and got this error message

Non-NULL controlling IUnknown was specified, and either the requested interface was not
IUnknown, or the provider does not support COM aggregation.

please advice. thanks in advance
 
Actually i do not think that is the coding problem cause i wrote the coding in a class. i have try to call this function in other form and it worked well. I also checked the parameter passed in. Can u let me know what are the posibility occur this error. i use debug mode to see the code, when it executed to the oConn.Open() it jump to the exception and show the error message. Anyway this is the coding

Public Function GetFromOledbToDataSet(ByVal sCommand As String) As DataSet
Dim oConn As New ADODB.Connection
oConn.ConnectionString = sConnectionString
oConn.CursorLocation = ADODB.CursorLocationEnum.adUseClient

Dim oResultRecordset As New ADODB.Recordset


Try
oConn.CommandTimeout = 10
oConn.Open()
oResultRecordset.ActiveConnection = oConn

oResultRecordset.MaxRecords = MaxNoOfRecord
oResultRecordset.CursorType = ADODB.CursorTypeEnum.adOpenStatic


oResultRecordset.Open(sCommand)

Dim oDataSet As New DataSet
Dim oOledbDataAdapter As New OleDbDataAdapter
oOledbDataAdapter.Fill(oDataSet, oResultRecordset, "FNDOCUMENT")

oConn.Close()
Return oDataSet
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex.Message)

Return Nothing
Finally
If Not oConn Is Nothing Then
If oConn.State = ConnectionState.Open Then
oConn.Close()
End If
End If
End Try


End Function
 
provider=FnDBProvider;data source=vpcscbapp;SystemType=2;LogonID=e8810f8a8cba3ef71a2d707f0b5b29d2;Prompt=4;Pooling=true;Min Pool Size=0;Max Pool Size=15"

sorry for late reply
 
Back
Top