• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

Create a recordset in DAO under VB6 environment


Hi,

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.OpenRecordset

mDAORecordSet.AddNew
  mDAORecordSet!ButtonType = "Admin"
  mDAORecordSet!CControl_ControlLabel = "No"
  mDAORecordSet.Update
Next


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


Thanks for any help
0
TungVan
Asked:
TungVan
  • 2
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
You probably need to refresh the tables collection between creating the table and actually referencing it.  
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Try application.RefreshDatabaseWindow
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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