Dll and ASP

Results 1 to 8 of 8

Thread: Dll and ASP

  1. #1
    Alice Guest

    Default Dll and ASP

    Hi,<BR><BR>I am using a VB dll to create SQL query. The query returns a recordset with 100 records. Can anyone tell me how I can pass the results of this recordset from the dll to the ASP page where I want to display it in a table.<BR><BR>Thanks in advance.<BR><BR>Alice

  2. #2
    Join Date
    Dec 1969
    Posts
    572

    Default RE: Dll and ASP

    Define the function that makes the SQL call as Recordset, and make to return your recordset.

  3. #3
    Alice Guest

    Default RE: Dll and ASP

    Ok, I got that, but how will I be able to go throught the records to display the data in the asp page. Also since I am not doing any ADO connection objects in the asp page, how will I be able to go through the records?<BR><BR>Do you have a sample code I could look at?<BR><BR>Thanks.<BR><BR>Alice

  4. #4
    Join Date
    Dec 1969
    Posts
    572

    Default RE: Dll and ASP

    You would do something like this:<BR>In the DLL:<BR>Function GetRecords () as ADODB.Recordset<BR>...<BR>...<BR>...<BR>GetRecords .Execute(SQL)<BR>In your ASP:<BR>Call GetRecords<BR>If not GetRecords.EOF or GetRecords.BOF Then<BR> Do until GetRecords.EOF<BR> &#039 Do whatever you need to do<BR> Loop<BR>End If <BR>


  5. #5
    Alice Guest

    Default RE: Dll and ASP

    Thanks for the reply.<BR><BR>My code in ASP is<BR><BR>Set oMyObject = Server.CreateObject("MyDll.clsMyClas")<BR>Call oMyObject.fnMyFunction("2")<BR>If Not fnMyFunction.EOF or fnMyFunction.BOF then<BR> Response.Write fnAssistanceInfo!FirstField<BR>End If<BR><BR>I dont think I can use the code in the "If-End If" block. How would I use it then? Can you resolve this last glitch???<BR><BR>Thanks a million.<BR><BR>Alice

  6. #6
    ALice Guest

    Default RE: Dll and ASP

    Hi,<BR><BR>What is GetRecords defined as and where?<BR><BR>Alice

  7. #7
    Join Date
    Dec 1969
    Posts
    572

    Default RE: Dll and ASP

    I don&#039t think I understood your question, but if you&#039re asking how to use loop in your case, there it is:<BR>If Not fnMyFunction.EOF or fnMyFunction.BOF then<BR> Do while not fnMyFunction.EOF<BR> Response.Write fnMyFunction.field(1), fnMyFunction.field(2),...<BR> fnMyFunction.MoveNext<BR> Loop<BR>End If<BR><BR>Hope it helps.<BR>

  8. #8
    Join Date
    Dec 1969
    Posts
    572

    Default RE: Dll and ASP

    GetRecords is a function that is defined as ADODB.Recordset in your .DLL

Posting Permissions

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