What's wrong with my code, getting Unspecifie

Results 1 to 3 of 3

Thread: What's wrong with my code, getting Unspecifie

  1. #1
    Matiur Rahman Guest

    Default What's wrong with my code, getting Unspecifie

    Environment: ASP with PWS on NT 4.0 workstation, ADO 2.6<BR>Database:Oracle 8i, Provider=oraOLEDB.Oracle<BR><BR>The pasge was working fine. And suddenly I get error when it is trying to get a recordset object. No other page would work at this point. I had to reboot my machine and then the page would work fine. What I am doing wrong? Below shows the ADO errors and necessary code. <BR><BR>Please help!!! Is the problem related to Oracle Provider?<BR><BR>ADO errors were recorded as follows:<BR><BR>Error Number:-2147467259<BR>Description:Unspecified error<BR>Source:OraOLEDB<BR>SQLState:<BR>Native Error:529745346<BR><BR>The order of Procedure/Functions are being called is:<BR> <BR>ProcessPage()--&#062;RetunRecordset(strSQL)--&#062;GetSQLReturnRS(strSQL)<BR><BR>************** ******Code for the ASP page shown belkow*****************<BR>&#060;HTML&#062;<BR>&#0 60;HEAD&#062;<BR>&#060;META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"&#062;<BR>&#060;/HEAD&#062;<BR>&#060;BODY&#062;<BR><BR>&#060;%<BR> dim rs<BR> call ProcessPage()<BR> &#039;After getting rs, it is being process here.<BR> &#039;that is Generating HTML<BR> <BR> rs.close<BR> set rs=nothing<BR> <BR>%&#062;<BR><BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062;<BR><BR>&#060;%<BR><BR> Dim rs<BR>&#039;***************ProcessPage************ *********** <BR>Sub ProcessPage()<BR>dim strSQL<BR><BR>strSQL="SELECT V_CU_VOLUME_BY_POSITION.SorterName Positions, " & _<BR> " V_CU_VOLUME_BY_POSITION.Total " & _<BR> " FROM V_CU_VOLUME_BY_POSITION WHERE V_CU_VOLUME_BY_POSITION.SortDate=&#039;" & trim(cstr(strLatestSortDate)) & "&#039;" & sortOrder<BR><BR> <BR> Err.Clear <BR> On Error Resume Next<BR> &#039;Call the function to get the recordset <BR> Set rs = ReturnRecordSet(strSQL)<BR> if err.number&#060;&#062;0 then<BR> set rs=nothing<BR> Response.End<BR> end if <BR> <BR> Call CheckForNoRecords()<BR> <BR> end sub<BR> &#039;******************************************** ************<BR> &#039;This function Uses GetData Class and Return a Recordset Object<BR> &#039;As input it takes a SQL string and ConnectionString <BR>&#039;********ReturnRecordset***************** ********************* <BR>Function ReturnRecordset(strSQL)<BR> Dim strCon <BR> Dim Obj<BR> Dim r<BR> dim strError<BR> <BR> <BR> strCon=""<BR> <BR> strCon=Application("ConnectionString") <BR> <BR> Set Obj = New GetData<BR> <BR> Obj.DataConnectString=strCon<BR> <BR> On error resume next<BR> Set r=Obj.GetSQLReturnRS(strSQL) <BR> if err.number&#060;&#062;0 then<BR> strError=Obj.ErrorInGetData &#039;Get error info from the property<BR> Response.Write "<BR>" & strError <BR> Set r=nothing<BR> Set obj=Nothing <BR> &#039;Call this sub to show an exit button <BR> Call ResponseEnd() <BR> end if<BR> <BR> Set ReturnRecordset=r <BR> <BR> Set r=nothing <BR> Set Obj=Nothing<BR> <BR> End Function <BR>&#039;**************************************** **************************** <BR>&#039;CLASS DECLARATION<BR>&#039;***************************** ************************************** <BR>Class GetData<BR><BR>Dim strErrorInGetData<BR>Dim strCon &#039;To hold the connection string<BR>dim intPageSize<BR><BR>Public Property Let DataConnectString(ByVal vNewValue)<BR> strCon = vNewValue<BR>End Property<BR><BR>Public Property Let PageSize(ByVal vNewValue) <BR> intPageSize = vNewValue<BR>End Property<BR><BR>Public Property Get ErrorInGetData() <BR> ErrorInGetData = strErrorInGetData<BR>End Property<BR><BR>&#039;*****************Return RecordSet Function**********************<BR>Public Function GetSQLReturnRS(strSQL) <BR> <BR> Dim rsRecordset <BR> Dim objCon <BR> <BR> On error Resume next <BR> Set objCon = Server.CreateObject("ADODB.Connection") <BR> if err.number&#060;&#062;0 then<BR> Set objCon = Nothing<BR> call ErrorHandler (1 , "ADODB.Connection", err.Description) <BR> Exit Function<BR> end if<BR> <BR> <BR> Set rsRecordset=Server.CreateObject("ADODB.Recordset") <BR> if err.number&#060;&#062;0 then<BR> Set rsRecordset=Nothing<BR> Set objCon = Nothing <BR> call ErrorHandler (1 , "ADODB.Recordset", err.Description) <BR> Exit Function<BR> end if <BR> <BR> objCon.Open strCon <BR> if err.number&#060;&#062;0 then<BR> Call ErrorHandler (2 , "Open Connection", err.Description) <BR> Call WriteToErrorLog(objCon) &#039;writing ado errors to a log file<BR> Set rsRecordset=Nothing<BR> Set objCon = Nothing <BR> Exit Function<BR> end if <BR> <BR> If len(intPageSize & "")&#060;1 then<BR> intPageSize=10<BR> end if<BR> <BR> <BR> With rsRecordset<BR> Set .ActiveConnection=objCon<BR> .CursorLocation = 3 &#039;adUseClient<BR> .CursorType = 2 <BR> .LockType = 1 &#039;adLockReadOnly<BR> .CacheSize = intPageSize<BR> End With<BR> <BR> err.Clear<BR> rsRecordset.Open strSQL <BR> if err.number&#060;&#062;0 then<BR> Call ErrorHandler (3 , "Open Recordset", err.Description)<BR> Call WriteToErrorLog(objCon) &#039;writing ado errors to a log file<BR> objCon.Close<BR> Set objCon = Nothing<BR> Set rsRecordset=Nothing <BR> Exit Function <BR> end if<BR> <BR> <BR> set rsRecordset.ActiveConnection = Nothing <BR> &#039;Return the recordset<BR> Set GetSQLReturnRS = rsRecordset<BR> <BR> Set rsRecordset=nothing<BR> <BR> objCon.Close<BR> Set objCon = Nothing<BR> <BR> End Function<BR> <BR>End Class<BR>&#039;*********************************** *******************************<BR>%&#062;<BR><BR> <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default What that means...

    ...is that the Oracle database driver is returning an error but is not giving a message to go with it.<BR><BR>If you look at this part of the error you do see:<BR>&nbsp; &nbsp; &nbsp; Native Error:529745346 <BR>that is telling you what error Oracle says it is getting. You&#039;ll have to get out your Oracle docs (and maybe convert the number to hexadecimal) to figure out what it really is.<BR>

  3. #3
    Matiur Rahman Guest

    Default RE: Is it an Oracle error?

    Thanks for your reply.<BR>I used "Provider=OraOLEDB.Oracle" in my connection string<BR>Now, I am trying with "Provider=msdaora" in my connection string<BR><BR>I think it is the problem with ADO and Oracle provider. But I don&#039;t know what the solution is.<BR><BR>I shall try to find what that error means. If you have any other suggestions, please post.<BR><BR>Thanks again.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts