ADODB Recordsets

Results 1 to 2 of 2

Thread: ADODB Recordsets

  1. #1
    Join Date
    Dec 1969

    Default ADODB Recordsets

    I have n HTML form with many fields. Some of these fields are pulldowns populated from diferent tables in the DB. I have one DB connection object, however I have many recordset objects. I placed the set statements in an include file for effiency and then opened appropriate recordsets in the various pages. Is this ok or is there a better way to do it?<BR><BR>Here is the code<BR>__________________________________________ ______________________<BR>connection.asp<BR>&#060; %<BR>dim addbrs, adservrs, apprs, conn, strconn<BR> <BR>strconn= "DRIVER=Oracle73Ver2.5;DBQ=name;UID=id;PWD=pass;<B R><BR> set conn = server.createobject("adodb.connection")<BR> <BR> set addrs = server.createobject("adodb.recordset")<BR> set apprs = server.createobject("adodb.recordset")<BR><BR> strconn<BR>%&#062;<BR>____________________________ _________________<BR>add.asp<BR>&#060;% "open statement"%&#062;<BR>_____________________________ ________________<BR>app.asp<BR>&#060;% "open statement"%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: ADODB Recordsets

    I don&#039t think that would be best. It will probably work but could create problems. You should not dim something that will not be used. At the end of your code you should always have something like<BR><BR>rec.Close<BR>Set rec = Nothing<BR>conn.close<BR>Set conn = Nothing<BR><BR>Since you only dimed both recordsets you will need to do the following on both recordset pages.<BR><BR>rec.Close<BR>Set rec = Nothing<BR>Set rec2 = Nothing<BR>conn.close<BR>Set conn = Nothing<BR><BR>If you do it this way you are wasting memory which may be worse than the improvement by having the code in an include file for time saved during development.<BR><BR>Or just loose the diming of the record sets on the include file, you are only saving two lines of code. But leave the connection in the include file.<BR><BR>Matt<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