PDA

Click to See Complete Forum and Search --> : Default Field Values


simonm
Sep 28th, 2000, 05:19 AM
With SQL database and using ADO, is there anyway to access in VB, the default values of particular fields in the database?

The field object of a recordset doesn't seem to have a 'defaultvalue' property and ADOX seems to have the same limitation.

Any ideas attall would be appreciated?

Simon.

VBOB
Sep 28th, 2000, 06:29 AM
Simonm,
It is actually straightforward. Code ....


Dim tbldefs As TableDef

Set tbldefs = dbs.TableDefs!<table name>
With tbldefs
c = .Fields(0).Size
End With
msg=msgbox(c)


___________

simonm
Sep 28th, 2000, 07:22 AM
That's not quite what I'm looking for.

Firstly, ADO doesn't have 'Tabledef' objects.

Secondly, I want the 'DEFAULT VLAUE' and not the 'SIZE' property of the field.

Thanks anyway.