473,608 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing MS Access Database Structure in ASP

How can I print the database structure, including non default
variables like Requiered, FieldSize, and most important DESCRIPTION. I
want a table like this:

-----------------------------------------------
| Name | Type | Size | Required | Description |
-----------------------------------------------
| ... | ... | ... | ... | ... |
Does anyone know how to do this? I can only print Name and Type as
they are predefined variables. Thanks in advance!

Alternatively, how can I copy my variable descriptions from MS Access'
Design View to another program (SPSS or EXCEL or a text document)? MS
Access doesn't allow copying the description fields (only one at a
time and I have 900 variables in my tables!!) and importing into SPSS
does not include the descriptions. All help is more than welcome!

Cheers!

Patricio
Nov 12 '05 #1
5 7732
pa************* @hotmail.com (Pato Secruza) wrote in message news:<21******* *************** ****@posting.go ogle.com>...
How can I print the database structure, including non default
variables like Requiered, FieldSize, and most important DESCRIPTION. I
want a table like this:

-----------------------------------------------
| Name | Type | Size | Required | Description |
-----------------------------------------------
| ... | ... | ... | ... | ... |
Does anyone know how to do this? I can only print Name and Type as
they are predefined variables. Thanks in advance!

Alternatively, how can I copy my variable descriptions from MS Access'
Design View to another program (SPSS or EXCEL or a text document)? MS
Access doesn't allow copying the description fields (only one at a
time and I have 900 variables in my tables!!) and importing into SPSS
does not include the descriptions. All help is more than welcome!

Cheers!

Patricio


Patricio,
cuidate con el nombre "pato"... significa maricon! (Lo juro!)
You can download the DFUtility addin from Danny Lesandrini's
website...

You could use something like this...

Public Sub ShowFieldDescri ptions(ByVal strTable As String)
Dim db As DAO.database
Dim tdf As DAO.tabledef
Dim fld As DAO.Field

Set db = CurrentDb
Set tdf = db.TableDefs(st rTable)
For Each fld In tdf.Fields
Debug.Print fld.Name, fld.Properties( "Descriptio n")
Next fld

Set fld = Nothing
Set tdf = Nothing
Set db = Nothing

End Sub

If you wanted, you could populate a table with the information, and
send that to Excel or whatever you want that SPSS or whatever can
read...

HTH a little,
Pieter
Nov 12 '05 #2
pi********@hotm ail.com (Pieter Linden) wrote in message news:<bf******* *************** ****@posting.go ogle.com>...
pa************* @hotmail.com (Pato Secruza) wrote in message news:<21******* *************** ****@posting.go ogle.com>...
How can I print the database structure, including non default
variables like Requiered, FieldSize, and most important DESCRIPTION. I
want a table like this:

-----------------------------------------------
| Name | Type | Size | Required | Description |

-----------------------------------------------
| ... | ... | ... | ... | ... |
Does anyone know how to do this? I can only print Name and Type as
they are predefined variables. Thanks in advance!

Alternatively, how can I copy my variable descriptions from MS Access'
Design View to another program (SPSS or EXCEL or a text document)? MS
Access doesn't allow copying the description fields (only one at a
time and I have 900 variables in my tables!!) and importing into SPSS
does not include the descriptions. All help is more than welcome!

Cheers!

Patricio

Public Sub DocumentTable(B yVal strTable As String)
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim rs As DAO.Recordset

Set db = CurrentDb
DoCmd.RunSQL "DELETE * FROM ztblDocumentati on;", dbFailOnError

'--Open the recordset that the documentation data will go into
Set rs = db.OpenRecordse t("ztblDocument ation", dbOpenTable)

'--Open the tabledef that will be documented.
Set tdf = db.TableDefs(st rTable)
For Each fld In tdf.Fields
rs.AddNew
rs.Fields("Tabl eName") = tdf.Name
rs.Fields("Fiel dName") = fld.Name
rs.Fields("Fiel dType") = GetFieldType(fl d.Type)
rs.Fields("Fiel dSize") = fld.Size
rs.Fields("Requ ired") = fld.Required
rs.Fields("Desc ription") = GetFieldDescrip tion(fld.Name,
tdf.Name)
rs.Update
Next fld

rs.Close
Set rs = Nothing
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
End Sub

Private Function GetFieldType(By Val lngType As Long) As String

Select Case lngType
Case dbBoolean
GetFieldType = "Yes/No"
Case dbCurrency
GetFieldType = "Currency"
Case dbDate
GetFieldType = "Date/Time"
Case dbGUID
GetFieldType = "GUID"
Case dbInteger
GetFieldType = "Integer"
Case dbLong
GetFieldType = "Long Integer"
Case dbLongBinary
GetFieldType = "Long Binary"
Case dbMemo
GetFieldType = "Memo"
Case dbNumeric
GetFieldType = "Numeric"
Case dbSingle
GetFieldType = "Single"
Case dbText
GetFieldType = "Text"
Case dbTime
GetFieldType = "Time"
Case dbTimeStamp
GetFieldType = "Date"
Case dbVarBinary
GetFieldType = "VarBinary. ... whatever!"
Case Else
GetFieldType = vbNullString
End Select

End Function
Public Function GetFieldDescrip tion(ByVal strField As String, ByVal
strTable As String) As String
On Error GoTo ErrHandler

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field

Set db = CurrentDb
Set tdf = db.TableDefs(st rTable)
Set fld = tdf.Fields(strF ield)

GetFieldDescrip tion = fld.Properties( "Descriptio n")

Set fld = Nothing
Set tdf = Nothing
Set db = Nothing

Exit Function

ErrHandler:
'For Each Err In Errors
Err.Clear
'Next Err
GetFieldDescrip tion = ""

End Function

Okay, then you could output the whole thing to HTML... just specify
the table and use the OutputTo function...
Nov 12 '05 #3
Okay, got it working to my satisfaction... although I output the
result to HTML instead of ASP... (just change the outputTo constant to
....ASP)

'--- begin dodgy code....

Public Sub DocumentTable(B yVal strTable As String)
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim rs As DAO.Recordset

Set db = CurrentDb
DoCmd.SetWarnin gs False
DoCmd.RunSQL "DELETE * FROM ztblDocumentati on;", dbFailOnError
DoCmd.SetWarnin gs True

'--Open the recordset that the documentation data will go into
Set rs = db.OpenRecordse t("ztblDocument ation", dbOpenTable)

'--Open the tabledef that will be documented.
Set tdf = db.TableDefs(st rTable)
For Each fld In tdf.Fields
rs.AddNew
rs.Fields("Tabl eName") = tdf.Name
rs.Fields("Fiel dName") = fld.Name
rs.Fields("Fiel dType") = GetFieldType(fl d.Type)
If fld.Type = dbText Then
rs.Fields("Fiel dSize") = fld.Size
End If
rs.Fields("Requ ired") = fld.Required
rs.Fields("Desc ription") = GetFieldDescrip tion(fld.Name,
tdf.Name)
rs.Update
Next fld

rs.Close
Set rs = Nothing
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
End Sub

Private Function GetFieldType(By Val lngType As Long) As String

Select Case lngType
Case dbBoolean
GetFieldType = "Yes/No"
Case dbCurrency
GetFieldType = "Currency"
Case dbDate
GetFieldType = "Date/Time"
Case dbGUID
GetFieldType = "GUID"
Case dbInteger
GetFieldType = "Integer"
Case dbLong
GetFieldType = "Long Integer"
Case dbLongBinary
GetFieldType = "Long Binary"
Case dbMemo
GetFieldType = "Memo"
Case dbNumeric
GetFieldType = "Numeric"
Case dbSingle
GetFieldType = "Single"
Case dbText
GetFieldType = "Text"
Case dbTime
GetFieldType = "Time"
Case dbTimeStamp
GetFieldType = "Date"
Case dbVarBinary
GetFieldType = "VarBinary. ... whatever!"
Case Else
GetFieldType = vbNullString
End Select

End Function
Public Function GetFieldDescrip tion(ByVal strField As String, ByVal
strTable As String) As String
On Error GoTo ErrHandler

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field

Set db = CurrentDb
Set tdf = db.TableDefs(st rTable)
Set fld = tdf.Fields(strF ield)

GetFieldDescrip tion = fld.Properties( "Descriptio n")

Set fld = Nothing
Set tdf = Nothing
Set db = Nothing

Exit Function

ErrHandler:
'For Each Err In Errors
Err.Clear
'Next Err
GetFieldDescrip tion = ""

End Function
Public Sub OutputTableToHT ML(ByVal strOutputPath As String)
DoCmd.OutputTo acOutputTable, "ztblDocumentat ion", acFormatHTML,
strOutputPath & "\Dox.html" , True
End Sub

'---End dodgy Code
Nov 12 '05 #4
Hey Thanks a lot Pieter!

I`ll check it out! I'm sure I'll be able to do it now.
Did you program it as a windows application or as a web script?

Nunca he escuchado lo de Pato... en cuál país aprendiste castellano, o
si eres latino, de cuál país eres?

I appreciate your effort!

Patricio
Nov 12 '05 #5
pa************* @hotmail.com (Pato Secruza) wrote in message news:<21******* *************** ****@posting.go ogle.com>...
Hey Thanks a lot Pieter!

I`ll check it out! I'm sure I'll be able to do it now.
Did you program it as a windows application or as a web script?

Nunca he escuchado lo de Pato... en cuál país aprendiste castellano, o
si eres latino, de cuál país eres?

I appreciate your effort!

Patricio


The code? I wrote it myself (well, probably with a lot of input from
this NG, to be totally honest). It would run inside Access... You'd
just put it in a code module...

Oi lo de pato desde hace mucho tiempo... aprendi en la calle, en la
escuela, en la universidad, en Espana... Latino? Yo?!! Soy MUY
rubio... mi padre es holandes.... pero la madre muy yanqui
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14029
by: Steve Johnson | last post by:
Been banging my head on this for two days now. Hope someone can help! My test program below is in the form of a single JSP, with a Node class build in. (All the coded needed to run is below.) The technical requirements: 1) Store tree data in the database so that it can be extracted as a tree structure. For test purposes,
3
24014
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I tried to update the links by changing the Connect property and refreshing: Set td = db.TableDefs(0)...
49
14314
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The application is relatively big: around 200 tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data (SQL Server 2000), 40 users. I'm wondering what are the disadvantages of using Access as front-end? Other that it's not...
6
1979
by: latosca68 | last post by:
I need to demostrate, in a forensic job, that I can change (insert, update, delete) records in a table of an access database without trace. How can I do this ? I plan to make the queries or export to excel, make the changes and import again. Does access logs this change. Very important: Exists any kind of date/time that access manage internaly. Something like MSysObects ? If exists how can I change? Thanks for your time !!! Alf
1
2689
by: Frank.Sebesta | last post by:
I have a employees database with a picture that shows on a form with employee information. Similar to the Northwinds sample database. When I print the record, my output is only the data and does not include the picture. My pictures reside on my C drive. How can I get the picture to print with the record or I would be happy to just print the picture seperately?
4
9227
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And this differences increases with the increase number of labels. The code is as follwods: Here rdr = OleDbDataReader Font is Times New Roman, 12pt
2
2299
by: Allen Davis | last post by:
I have some hierarchical data bound to a series of nested DataLists and DataGrids for which I'd like to be able to provide the end-user some targeted printing capabilities. By that I mean being able to send just one parent dataitem and all its children to the printer. Does anyone have any good suggestions for how to do this or where to look for ideas about how to accomplish it? Thanks
15
2414
by: sparks | last post by:
We get more and more data done in excel and then they want it imported into access. The data is just stupid....values of 1 to 5 we get a lot of 0's ok that alright but 1-jan ? we get colums that are formatted for number and then half way down they are changed to text. OR the famous ok now everything in red is ---- and everything in blue is---------. WTF are these people thinking?
2
1427
by: coldblood22 | last post by:
Well in my Application i am using the java Printable interface to print the GUI. The printing is done fine but once done with the printing my program breaks off with the database file without. Well i haven't made any calls to close the database after printing. But after printing, none of the modules recognize the database file. I manually tried to close and open the database after printing but still it is not able to access the tables. I am...
0
7987
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8464
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8130
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8324
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6000
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3954
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1574
muto222
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.