|
-
March 14th, 2001, 02:44 PM
#1
Add fields in table mdb with Data.Recordset.Fields.append.....is't possible
I would like to add new fields in my database YY.mdb
like
NomChamp_s = "XXX"
Set f = New Field
f.Name = NomChamp_s
f.Type = dbText
f.Size = 10
Data.Recordset.Fields.Append f
But I received an error.
Who can help me?
Thanks
Redg
-
March 14th, 2001, 02:56 PM
#2
Re: Add fields in table mdb with Data.Recordset.Fields.append.....is't possible
Dim tbl As ADOX.Table
Set tbl = New ADOX.Table
tbl.Name = "tblCustomer"
cat.Tables.Append tbl
'=========
Dim col As ADOX.Column
Set col = New ADOX.Column' Create first name field
With col
.Name = "FirstName"
.DefinedSize = 50
End With
' Add the new column to the table.tbl.Columns.Append colSet col = New ADOX.Column
' Create last name field.
With col
.Name = "LastName"
.DefinedSize = 50
End With
' Add the new column to the table.
tbl.Columns.Append col
'or--------shortcut to add column------
tbl.Columns.Append "FirstName", _
adVarWChar, 50
tbl.Columns.Append "LastName", _
adVarWChar, 50
'------------
Iouri Boutchkine
[email protected]
-
March 14th, 2001, 05:45 PM
#3
Re: Add fields in table mdb with Data.Recordset.Fields.append.....is't possible
Try using createfield and then append it to the tabledef
- Srikanth
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|