User Tools

Site Tools


vba:access:functions:printrs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
vba:access:functions:printrs [08.05.2015 10:59:16]
yaslaw
vba:access:functions:printrs [18.08.2017 12:11:31]
yaslaw
Line 1: Line 1:
 <​const>​ <​const>​
-    version=1.5.2 +    version=3.1.0 
-    vdate=21.04.2015+    vdate=16.08.2017
     fname=udf_printrs.bas     fname=udf_printrs.bas
     ns=%NAMESPACE% ​   ​     ns=%NAMESPACE% ​   ​
Line 12: Line 12:
 ==Version %%version%% (%%vdate%%)== ==Version %%version%% (%%vdate%%)==
  
-printRs() ist dazu gedacht, schnell die ersten X Zeilen ​eines DAO.Recordsets ​als Text auszugeben. Das ist praktisch für Debug-Zwecke ​oder auch um Beispiele zu Funktionen zu dokumentieren.+printRs() ist dazu gedacht, schnell die ersten X Zeilen ​einer Quelle (Tabelle, Abfrage, Recordset etc) als fornatierten ​Text auszugeben. Das ist praktisch für Debug-Zweckeum Beispiele zu Funktionen zu dokumentieren ​oder um Tabelleninhalte/​Resultate in ein Forum zu posten. 
 + 
 +Wird zum Beispiel in der [[vba:​access:​classes:​sqlscript]] verwendet
  
 {{%%ns%%:​%%fname%%|Download %%fname%% (V-%%version%%)}} {{%%ns%%:​%%fname%%|Download %%fname%% (V-%%version%%)}}
  
 ===== Definition ===== ===== Definition =====
 +<WRAP center round important 60%>
 +Diese Funktion verwendet die Funktion [[vba:​functions:​printlist|]]
 +</​WRAP>​
  
-<​code>​printRs(SELECT-Statement [,limit [,​returnType]]) + 
-printRs(recordset [,limit [,​returnType]]) +<​code>​printRs(SELECT-Statement [,limit [,​returnType[, cancel]]]) 
-printRs(tabellenname [,limit [,​returnType]]) +printRs(recordset [,limit [,​returnType[, cancel]]]) 
-printRs(TableDef [,limit [,​returnType]]) +printRs(tabellenname [,limit [,​returnType[, cancel]]]) 
-printRs(viewname [,limit [,​returnType]]) +printRs(TableDef [,limit [,​returnType[, cancel]]]) 
-printRs(QueryDef [,limit [,​returnType]])</​code>​+printRs(viewname [,limit [,​returnType[, cancel]]]) 
 +printRs(QueryDef [,limit [,​returnType[, cancel]]])</​code>​
  
 <code vb>​Public Function printRs( _ <code vb>​Public Function printRs( _
Line 47: Line 53:
 ===== Beispiele ===== ===== Beispiele =====
 Direkt im Immadiate-Window Direkt im Immadiate-Window
-<code vb>​printrs currentdb.OpenRecordset("​my_table"​),​ 5+<code vb>'​Resultat einer Abfrage 
 +printrs "​vw_pivot_source"​ 
 +| w1 | <> | 1 | 2 | 4 | 
 +|----|----|---|---|---| 
 +| 1  |    | 2 |   ​| ​  | 
 +| 2  |    |   | 1 |   | 
 +| 3  |    |   | 1 | 1 | 
 +| 4  | 0  |   ​| ​  ​| ​  | 
 + 
 +'Erste 5 Zeilen eines Recorsets 
 +printrs currentdb.OpenRecordset("​my_table"​),​ 5
 | ID | f_date ​             | f_string | f_double ​ | | ID | f_date ​             | f_string | f_double ​ |
 |----|---------------------|----------|-----------| |----|---------------------|----------|-----------|
Line 56: Line 72:
 | 11 | 14.03.2014 00:10:00 |          | 0.5       | | 11 | 14.03.2014 00:10:00 |          | 0.5       |
  
 +'​Rückgabe als String
 ?​printrs("​my_table",​ 5, prsReturn) ?​printrs("​my_table",​ 5, prsReturn)
 | ID | f_date ​             | f_string | f_double ​ | | ID | f_date ​             | f_string | f_double ​ |
Line 65: Line 82:
 | 11 | 14.03.2014 00:10:00 |          | 0.5       | | 11 | 14.03.2014 00:10:00 |          | 0.5       |
  
 +'​Direktes Auswerten eines SQL-Befehls
 printrs "​SELECT id, f_double FROM my_table ORDER BY f_double DESC", 5 printrs "​SELECT id, f_double FROM my_table ORDER BY f_double DESC", 5
 | id | f_double ​  | | id | f_double ​  |
vba/access/functions/printrs.txt · Last modified: 18.08.2017 12:18:45 by yaslaw