Boletín Visual Basic #3 - 13-OCT-2001
INDICE
1. UNAS PALABRAS DEL EDITOR
2. VBA: MACRO DE WORD QUE MUESTRA LA ESTRUCTURA DE UNA BASE DE DATOS
3. VB.NET DESPUES DE VISUAL BASIC 6
4. ARTICULOS EN LA RED
########################################################################
1. UNAS PALABRAS DEL EDITOR
En esta tercera edición me complace presentar un ejemplo de VBA escrito
por Darshan Pandit.
Me alegra anunciar que este boletín ha alcanzado los 1000 suscriptores
en total. Este boletín puede crecer en contenido y cantidad de suscrip-
tores SÓLO gracias a su colaboración. Si usted es autor de algún
material que considere digno de publicarse, por favor envíenoslo.
Enlaces a material interesante en la web también son muy bienvenidos.
Por favor reenvíe este boletín a colegas y amigos que puedan estar
interesados en esta publicación.
Quisiera aprovechar la oportunidad para invitarlo a unirse a nuestros
foro Visual Basic en Yahoo! Grupos donde podrá intercambiar experiencia
con otros programadores:
* Foro abierto para todos los niveles:
http://espanol.groups.yahoo.com/group/vbasic-es
vbasic-es-subscribe@yahoogroups.com
* Foro de nivel intermedio (para quienes ya saben bastante de VB):
http://espanol.groups.yahoo.com/group/vbasic-intermedio
vbasic-intermedio-subscribe@yahoogroups.com
Puede cambiar sus opciones de suscripción en el foro, por ejemplo para
no convertir los mensajes a HTML o para no recibir los mensajes por
email (aún podrá ver los mensajes en el sitio web):
http://espanol.groups.yahoo.com/group/vbasic-es/join
http://espanol.groups.yahoo.com/group/vbasic-intermedio/join
Atentamente,
Ernesto De Spirito
eds2004 @ latiumsoftware.com
########################################################################
2. VBA: MACRO DE WORD QUE MUESTRA LA ESTRUCTURA DE UNA BASE DE DATOS
Darshan Pandit, uno de los miembros de nuestro foro vbasic-en, y también
suscriptor de este boletín, envió una macro de Word que pone la
estructura de las tablas de una base de datos Access en tablas en
páginas separadas de un documento de Word.
Macro de Word "table_info":
---------------------------
Option Explicit
Option Compare Text
Sub TABLE_INFO()
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Dim TB As DAO.TableDef
Dim FLD As DAO.Field, FLD2 As DAO.Field
Dim INDX As DAO.Index
Dim RNG As Word.Range
Dim X, Z, CMN
Dim FLDTYPE(1 To 23) As String
On Error GoTo ERRH
FLDTYPE(16) = "Big Integer"
FLDTYPE(9) = "Binary"
FLDTYPE(1) = "Boolean"
FLDTYPE(2) = "Byte"
FLDTYPE(18) = "Char"
FLDTYPE(5) = "Currency"
FLDTYPE(8) = "Date / Time"
FLDTYPE(20) = "Decimal"
FLDTYPE(7) = "Double"
FLDTYPE(21) = "Float"
FLDTYPE(15) = "GUID"
FLDTYPE(3) = "Integer"
FLDTYPE(4) = "Long"
FLDTYPE(11) = "Long Binary (OLE Object)"
FLDTYPE(12) = "Memo"
FLDTYPE(19) = "Numeric"
FLDTYPE(6) = "Single"
FLDTYPE(10) = "Text"
FLDTYPE(22) = "Time"
FLDTYPE(23) = "Time Stamp"
FLDTYPE(17) = "VarBinary"
MsgBox "Por favor seleccione el archivo *.MDB", vbOKOnly, _
"Seleccione Archivo..."
Set CMN = New CommonDialog
CMN.DialogTitle = "Abrir Archivo..."
CMN.InitDir = ActiveDocument.Path
CMN.Filter = "BD Access (*.MDB)|*.mdb|Todos los archivos (*.*)|(*.*)"
CMN.Flags = cdlOFNHideReadOnly
CMN.MaxFileSize = 1024
CMN.ShowOpen
Set DB = DBEngine.OpenDatabase(CMN.FileName)
ActiveDocument.Content.Delete
X = ""
For Each TB In DB.TableDefs
If TB.Attributes <> 0 Then
Else
X = "Nombre de tabla: " & vbTab & TB.Name + vbCrLf + vbCrLf
X = X + "Campo" + vbTab + "Tipo" + vbTab + "Tamaño" _
+ vbCrLf + vbCrLf
Set RNG = ActiveDocument.Paragraphs.Last.Range
Set RS = DB.OpenRecordset(TB.Name, dbOpenDynaset)
For Each FLD In RS.Fields
For Each INDX In TB.Indexes
If INDX.Primary = True Then
For Each FLD2 In INDX.Fields
If FLD2.Name = FLD.Name Then X = X + "[Clave Primaria] "
Next FLD2
End If
Next INDX
'check whether field is system field used for replication
If InStr(1, FLD.Name, "s_", vbTextCompare) = 0 Then
X = X + FLD.Name + String(15 - Len(FLD.Name), " ") & vbTab & _
FLDTYPE(FLD.Type) & String(25 - Len(FLDTYPE(FLD.Type)), " ") _
& vbTab & FLD.Size & vbCrLf
End If
Next FLD
RNG.Text = X
RNG.ConvertToTable vbTab, , 3
For Each Z In RNG.Tables(RNG.Tables.Count).Columns
Z.Select
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Next Z
RNG.Tables(RNG.Tables.Count).Columns(1).Select
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
RNG.Collapse
RNG.InsertBreak Type:=wdPageBreak
End If
Next TB
DB.Close
MsgBox "CADA INFORMACION DE TABLA HA SIDO ESCRITA EN UNA TABLA " _
& "SEPARADA EN PAGINA SEPARADA", vbInformation, "¡LISTO!"
Exit Sub
ERRH:
MsgBox "ERROR: " & Err.Number & " : " & Err.Description
End Sub
########################################################################
3. VB.NET DESPUES DE VISUAL BASIC 6
Hay mucha excitación acerca de VB.NET entre los programadores en VB,
pero detrás de algunas características nuevas como la herencia de
verdad, hilos de ejecución libres y compatibilidad multilenguaje, habrá
cambios en la forma en que las aplicaciones son codificadas e incluso
diseñadas. Los programadores se comienzan a preocupar a medida que se
empiezan a dar cuenta que la mayoría de las aplicaciones en Visual Basic
6 existentes no compilarán sin cambios en VB.NET (e incluso si lo hacen,
no se comportarán como se espera).
VB.NET no es una actualización (upgrade) de VB6. Aunque el lenguaje
pueda parecer muy familiar, de todos modos es un nuevo lenguaje, y las
aplicaciones viejas tendrán que ser portadas para compilar y trabajar
como se espera en el nuevo entorno.
He aquí algunos artículos sobre el asunto, incluyendo artículos de Bruce
McKinney y Bob Butler, dos reconocidos gurúes de Visual Basic:
* VB.Net for the VB6 Developer - por Bob Butler, 2001
http://home.earthlink.net/~butlerbob/VBNet/index.htm
* Moving to VB.Net - por Bob Butler, 2001
http://home.earthlink.net/~butlerbob/VBNet/AllPorting.htm
* Developers cry foul over new Microsoft language - por Mary Jo Foley,
2001
http://news.cnet.com/news/0-1003-201-4523043-0.html?tag=st.ne.ron.lthd
* .NET Changes Can't Be Ignored - 2001
http://www.geocities.com/antivisualbasic/cantbeignored.html
* The New Visual Basic - por Mike James, 2000
http://www.vsj.co.uk/archive/dec2000/vb/hovb1-0012.asp
* Get Your Designs in Gear for VB.NET - por Paul R. Reed Jr., 2000
www.vbpj.com/upload/free/features/vbpj/2000/11nov00/pr0011/pr0011.asp
* Visual Basic.NET Revealed - por Bruce McKinney, 2000
http://members.home.net/bruce2u2/vbnet.htm
########################################################################
4. ARTICULOS EN LA RED
* VBA Algorithms: Data Structures - por Rod Stephens
This article explains how to use VBA's fundamental data types to build
a variety of dynamic data structures, including resizable arrays,
linked lists, trees, and sparse arrays. These data structures and
their associated algorithms give a program the flexibility it needs
for advanced data handling.
http://www.microsoft.com/officedev/articles/movs205.htm
* Multithreading in Visual Basic
http://www.microsoft.com/msj/0897/multithreading.htm
http://www.desaware.com/articles/threadingL3.htm
http://www.1perlstreet.com/xq/ASP/txtCodeId.24579/lngWId.1/qx/vb/
scripts/ShowCode.htm
http://www.planet-source-code.com/xq/ASP/txtCodeId.14479/lngWId.1/qx/
vb/scripts/ShowCode.htm
http://gethelp.devx.com/techtips/thevbpro/10_minute_solutions/feb01/
10min0201ma.asp
* Send and Receive E-Mail Messages with Visual Basic
Using MAPI (messaging application program interface) controls to
create mail-enabled Visual Basic applications.
http://visualbasic.about.com/library/weekly/aa051401a.htm
* Advanced SQL Techniques - Part 1: Analyzing Duplicate Records - por
David Penton
Quick and efficient way to delete duplicate records from a table.
http://www.15seconds.com/issue/011009.htm
* Screen Savers - Inside & Out
Windows screen savers are among the most popular downloads on the Web.
Screen savers will extend your monitor's life, but at the same time
they can extend your privacy and entertain you. Learn how to make one
of your own.
http://visualbasic.about.com/library/weekly/aa050701a.htm
* Learning ADSI - Part I: Adding Users To W2K - por Remie Bolte
Introduction to ADSI using code to add users to W2K
http://www.15seconds.com/issue/011005.htm
* Top 5 API Tricks
Introduction to the APIs with five examples
http://visualbasic.about.com/library/weekly/aa040901a.htm
* Creating PGP-Encrypted E-Mails - por Selva Kumar
PGP is an encryption program used for secure transmission of files and
e-mails. This article explains the concepts of PGP, provides details
about installing and configuring the command-line version of PGP, and
explains how an encrypted e-mail can be generated from ASP.
http://www.15seconds.com/issue/011002.htm
* Accessing the Windows Registry with the API - por John Percival
http://vb-world.net/articles/registry2/
* Advanced UI Design Using XML and XSL: Custom Context Menu Creation -
por Joe Slovinski
This article explains how to create a custom, object-specific context
menu of unlimited depth by using XML and XSLT.
http://www.15seconds.com/issue/010927.htm
* Advanced UI Design Using XML and XSL: Folder Tree Creation - por Joe
Slovinski
This article explains how to create a folder tree of unlimited depth by
using XML and XSL, the style-sheet language for XML.
http://www.15seconds.com/issue/010921.htm
* Creating Web Service Client Code Automatically - por Robert Chartier
A wizard that creates Web Service client files for you, based on the
Simple Object Access Protocol (SOAP) Toolkit V2, SP 2.
http://www.15seconds.com/issue/010918.htm
* Charting the Internet - por Mark Mathieson
Step-by-step approach to automatically generate a bar (or pie) chart
from data stored in a database. Then, dynamically hot spots are added
to the bars/slices in the chart to link them to other pages.
http://www.15seconds.com/issue/010914.htm
* Randomizing a Recordset - por Edward Myers
ASP code to shuffle a recordset so that it can be displayed in random
order.
http://www.15seconds.com/issue/010911.htm
* Firing Events in a Shared Hosting Environment - por Matthew Muller
Firing events on a Web server when you don't have your own dedicated
IIS or SQL Server on the Internet.
http://www.15seconds.com/issue/010905.htm
* Create Your Own Visual Basic Add-Ins - por S.S. Ahmed
How to create VB add-ins to add features to the IDE.
http://www.15seconds.com/issue/010828.htm
########################################################################
Este boletín se provee "TAL COMO ESTA" sin garantía de ninguna clase.
Su uso implica la aceptación de nuestros términos de licencia y de la
ausencia de garantía que puede leer en nuestro sitio web, donde también
encontrará una nota sobre marcas registradas. Lo animamos a que
redistribuya este boletín siempre y cuando lo haga en forma completa
(incluyendo la información de copyright), gratuita y sin modificaciones.
------------------------------------------------------------------------
Latium Software http://www.latiumsoftware.com/es/index.php
------------------------------------------------------------------------
Copyright (c) 2001 por Ernesto De Spirito. Todos los derechos reservados
------------------------------------------------------------------------
|