ADODC and Custom RecordSet

Results 1 to 3 of 3

Thread: ADODC and Custom RecordSet

  1. #1
    Join Date
    Dec 1969

    Default ADODC and Custom RecordSet

    Trying to implement what was in the article "Using ADO Stand-Alone Recordsets as an Alternative to Arrays or Dictionaries" by Roman Koch posted on the website. The article says "use the ADO Data Control, you can set the RecordSource property of the control to your stand-alone recordset and then use the power of a linked DataGrid control to work with your in-memory data! "<BR><BR>I have some custom data files (custom &#039;.ABC&#039; files not delimited with characters, each record is the same size), I create custom recordsets within the code. I want to display the records in the recordset in a datagrid. <BR><BR>I am trying to use the ADO Data Control (ADODC) but am having problems. <BR>I do not know what to fill in on the ADODC&#039;s General Properties page for connection - there is no database and no delimiting characters in the data file .<BR>The RecordSource Property Page has fields for Command Type, Table or Stored Procedure and Command Text (SQL). I have tried to put in the Command Text -"Select * from MyRecordset".<BR> <BR>Error msg with Data source name not specified, no default driver specified. Please help.

  2. #2
    Sreedharan Guest

    Default First create an DSN...

    Here is one way to do it.<BR><BR>Create a DSN for your file. To do this, Open your Control Panel. Open "Data Sources". Click on the "System DSN" tab (you may also use "User DSN"). Click on the "Add..." button. Select Microsoft Text Driver (*.txt, *.csv). Click on Finish. This will open another window. Give the Data Source Name. Click on "Options &#062;&#062;". You can add your own custom extension. You can also set the Directory in which your file will reside.<BR><BR>Use this DSN which you have created to access your file. Here I am not sure how you will access your fixed length file. Try it out and use your ingenuity.

  3. #3
    Join Date
    Dec 1969

    Default RE: ADODC and Custom RecordSet

    Found a way around my problem.<BR><BR>In the code after filling the recordset. I set the ADODC recordset property to my recordset<BR>" Set Adodc1.Recordset = MyRecordset"<BR>My datagrid&#039;s datasource is set to the Adodc1.<BR>The datagrid is populated with the records from the recordset. Whew!!!!<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