Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

how to get recordset on asp

I have build a aumation object,I want to send a recordset
to asp script with it.
I have build the library as folow
funciton getlist:olevariant
begin
adoquery.close;
adoquery.open;
result:=adoquery.recordset;
end;

then How can I do in asp script
0
gutian
Asked:
gutian
1 Solution
 
EpsylonCommented:
Something like

<%
Set rs = getlist
%>
0
 
gutianAuthor Commented:
but I cannot get the result,so I change the server source
as the follow:
procedure CreateVarArrayFromDataset(var varResultSet: OleVariant; ADataset : TDataset);
var
  m : Integer;
  nRecords, nColumns, nCurRec : Integer;
begin
  nColumns := Max(0, ADataset.FieldCount-1);
  nRecords := Max(0, ADataset.RecordCount);
  varResultSet := VarArrayCreate([0, nColumns, 0, nRecords], varVariant);
  for m := 0 to nColumns do
    varResultSet[m, 0] := ADataset.Fields[m].DisplayLabel;
  ADataset.First;
  nCurRec := 1;
  while not ADataset.Eof do
  begin
    for m := 0 to nColumns do
      varResultSet[m, nCurRec] := ADataset.Fields[m].Value;
    ADataset.Next;
    Inc(nCurRec);
  end;
end;


function TEasyMail.GetAddressList(UserName: OleVariant): OleVariant;
begin
if GetDataSvr then
    begin
        with DmSysData.AdqGetUsr do
            begin
                close;
                sql.Clear;
                sql.Add('select * from hyjh_mail_addressbook where user_id=:username');
                parameters.ParamByName('username').value:=username;
                try
                    open;
                    FRecordCount:=RecordCount;
                    FColumnCount:=FieldCount;
                    CreateVarArrayFromDataset(Result,DmSysData.AdqGetUsr as TdataSet);
                except
                    execsql;
                    result:='';
                end;
            end;
            result:='';
    end
else
    result:='';
end;

but how can I get the reecordset
0
 
gutianAuthor Commented:
I have resolve the problem,thanks for  Epsylon'kind answer.
But  Epsylon' answer is not correct,can I ask you another
question.
I want to send mail from web,I wannor how to manage the attachments on web.
BTW  I have done the upload file.
0
 
Russell LibbySoftware Engineer, Advisory Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To be PAQ/Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0
 
PashaModCommented:
Per recommendation,

PashaMod
Community Support Moderator @Experts Exchange
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now