Create a recordset in DAO under VB6 environment

Posted on 2005-04-13
Last Modified: 2008-02-26


I have a table called Button. It has the following fields: ButtonType, CControl_ControlLabel, CControl_Height, CControl_Width.

I want to create a recordset, to later insert it into that table.

mDAORecordSet.Fields.Append "ButtonType", adVarChar, 255, adFldUpdatable
mDAORecordSet.Fields.Append "CControl_ControlLabel", adVarChar, 255, adFldUpdatable
mDAORecordSet.Fields.Append "CControl_Height", adInteger, , adFldKeyColumn
mDAORecordSet.Fields.Append "CControl_Width", adInteger, , adFldKeyColumn

  mDAORecordSet!ButtonType = "Admin"
  mDAORecordSet!CControl_ControlLabel = "No"

But I have "type mistmatch" error at "ButtonType"

Thanks for any help
Question by:TungVan
    LVL 65

    Expert Comment

    by:Jim Horn
    You probably need to refresh the tables collection between creating the table and actually referencing it.  
    LVL 65

    Accepted Solution

    Try application.RefreshDatabaseWindow

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now