473,473 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Table "Description"

1 New Member
If you right click on a table name in the tables window and click on properties you get a dialog box that allows you to add a description of the table. My question is using VBA how do you access that 'description' property??? It's NOT a TableDefs property but it is being stored somewhere... Any Ideas?

Thanks!!!
Sep 25 '06 #1
4 10108
PEB
1,418 Recognized Expert Top Contributor
Hi,

You can do it by Create property in Mdb

See this exemples from Northwind they can help you to update te properties!

:)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Sub CreatePropertyX()
  3.  
  4.    Dim dbsNorthwind As Database
  5.    Dim prpLoop As Property
  6.  
  7.    Set dbsNorthwind = OpenDatabase("Northwind.mdb")
  8.  
  9.    ' Set the Archive property to True.
  10.    SetProperty dbsNorthwind, "Archive", True
  11.  
  12.    With dbsNorthwind
  13.       Debug.Print "Properties of " & .Name
  14.  
  15.       ' Enumerate Properties collection of the Northwind 
  16.       ' database.
  17.       For Each prpLoop In .Properties
  18.          If prpLoop <> "" Then Debug.Print "  " & _
  19.             prpLoop.Name & " = " & prpLoop
  20.       Next prpLoop
  21.  
  22.       ' Delete the new property since this is a 
  23.       ' demonstration.
  24.       .Properties.Delete "Archive"
  25.  
  26.       .Close
  27.    End With
  28.  
  29. End Sub
  30.  
  31. Sub SetProperty(dbsTemp As Database, strName As String, _
  32.    booTemp As Boolean)
  33.  
  34.    Dim prpNew As Property
  35.    Dim errLoop As Error
  36.  
  37.    ' Attempt to set the specified property.
  38.    On Error GoTo Err_Property
  39.    dbsTemp.Properties("strName") = booTemp
  40.    On Error GoTo 0
  41.  
  42.    Exit Sub
  43.  
  44. Err_Property:
  45.  
  46.    ' Error 3270 means that the property was not found.
  47.    If DBEngine.Errors(0).Number = 3270 Then
  48.       ' Create property, set its value, and append it to the 
  49.       ' Properties collection.
  50.       Set prpNew = dbsTemp.CreateProperty(strName, _
  51.          dbBoolean, booTemp)
  52.       dbsTemp.Properties.Append prpNew
  53.       Resume Next
  54.    Else
  55.       ' If different error has occurred, display message.
  56.       For Each errLoop In DBEngine.Errors
  57.          MsgBox "Error number: " & errLoop.Number & vbCr & _
  58.             errLoop.Description
  59.       Next errLoop
  60.       End
  61.    End If
  62.  
  63. End Sub
  64.  
Sep 26 '06 #2
weased
2 New Member
I tried this and it doesn't work

I get a problem on:

Set prp = tbl.CreateProperty("Description", dbText, strName)

(It's also asking for [DDL] after strName ... what is DDL?
Nov 23 '06 #3
weased
2 New Member
I got it:

I simply combined the "Set" and "Append" Statements

(I'm referencing my code, but you should get the gist):

tbl.Properties.Append tbl.CreateProperty("Description", dbText, strName)
Nov 23 '06 #4
edwarric1
1 New Member
This is very helpful but how can I replace the description of it already exists?
Nov 20 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: EricRobineau | last post by:
hello I have a DB with many inter-related tables (MySQL) My main table called "content" has almost only foreign keys (integers) some have a 3 level relation (ex: content->city->region->country) ...
11
by: MLH | last post by:
I have a query field... Description: & "2-tone" When I run it, the output in that field is empty. If I change the name to MyDescription - it works fine. I noticed the query field has a...
1
by: Pucca | last post by:
I'm using vs2005, .net 2.0 on Windows 2000 server. When I double click on an entry of the "Security" log in the system's "Event Viewer", a Property window pops up. In this window, there is a...
0
by: bbcrock | last post by:
I have approximately 400 column descriptions stored in an MS Word document in MS Word tables that I want to insert into SQL Server utilizing the sys.sp_addextendedproperty function. Cutting and...
4
by: thaytu888888 | last post by:
Here is my codes in aspx page: <td colspan="2" class="main_menu" runat="server" onclick='toggleDisplay(<%#Eval("description")%>);'><%#Eval("description")%></td> Here is in "View source": ...
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
2
by: atishrg | last post by:
Hello All Need your help.. I created addin for outlook 2007 in vs2005(vb.net)... It is working fine now I Migrated that to vs2008 and created setup for that in vs2008...
8
by: ismailc | last post by:
Hi, I would like to change the text color of (<xsl:value-of select="Description") onmouseover of image. the javascript works, it's just that i can seem to get the name correct <td>...
1
by: silverachilles | last post by:
Hello, I have php code which takes an rss feed and outputs it on a page of my website. For each item it shows the link, title and description. My problem is the description element contains a lot...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.