Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / November 2005



Tip: Looking for answers? Try searching our database.

finding the default value of a recordset field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pol_c@tiscali.co.uk - 25 Nov 2005 09:40 GMT
Hi, i am using the function below (visual basic 6) to determine several
properties of
each field in a recordset (SQL server) and all is working well. My
problem is that I
dont know how to find the default value of a field from the table. Does
anyone have
any code suggestions that would get me the default value

For Each F In rstProgressData.Fields
   If F.Type <> adChapter Then
     If F.Name <> "upsize_ts" Then
       rstDest.AddNew
       rstDest!Progress = F.Name

       Select Case F.Type
         Case adChar, adVarWChar, adVarChar
            rstDest!ProgressFieldType = "String"
            rstDest!ProgressFieldSize = F.DefinedSize
         Case adBoolean
           rstDest!ProgressFieldType = "Boolean"
         Case adSmallInt, adUnsignedTinyInt, adInteger
            rstDest!ProgressFieldType = "Integer"
         Case adDecimal, adNumeric
           rstDest!ProgressFieldType = "Decimal"
         Case adDBTimeStamp
           rstDest!ProgressFieldType = "DateTime"
         Case 203
           rstDest!ProgressFieldType = "Memo"
       End Select

       If (F.Attributes And adFldIsNullable) = adFldIsNullable Then
         rstDest!ProgressFieldNullable = True
       End If

       rstDest.Update
     End If
   End If
 Next F
Veign - 25 Nov 2005 15:17 GMT
No need to post the question again as you original is only a day old.

Signature

Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--

> Hi, i am using the function below (visual basic 6) to determine several
> properties of
[quoted text clipped - 34 lines]
>    End If
>  Next F
pol_c@tiscali.co.uk - 28 Nov 2005 10:44 GMT
Thanks for your knowledgeable contibution chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.