User Tools

Site Tools


vba:access:functions:persist

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
vba:access:functions:persist [09.10.2014 16:48:11]
yaslaw
vba:access:functions:persist [04.09.2019 11:57:48] (current)
yaslaw
Line 1: Line 1:
 <​const>​ <​const>​
-    version=1.2.1 +    version=1.4.1 
-    vdate=09.09.2014+    vdate=03.09.2019
     fname=udf_persist.bas     fname=udf_persist.bas
     ns=%NAMESPACE%     ns=%NAMESPACE%
Line 7: Line 7:
 </​const>​ </​const>​
 ====== [VBA][Access] persist() ====== ====== [VBA][Access] persist() ======
-==Version %%version%% (%%vdate%%)== +//Eine Funktion für ein einfacher INSERT INTO...ON DUPLICATE UPDATE//
-Eine Funktion für ein einfacher INSERT INTO...ON DUPLICATE UPDATE+
  
 +==Version %%version%% - %%vdate%%==
 Die Funktion eignet sich gut, um schnell eine kleine Änderung (Add /Update) auf eine Tabelle anhand des %%PrimaryKey%% auszuführen. Die Funktion eignet sich gut, um schnell eine kleine Änderung (Add /Update) auf eine Tabelle anhand des %%PrimaryKey%% auszuführen.
  
Line 136: Line 136:
 <code vb>'​Neuen Datensatz erstellen <code vb>'​Neuen Datensatz erstellen
 Dim newId As Long Dim newId As Long
-newId = >persist("​T_USERS_INFO",​ array("​user name", "​system-id"​),​ array("​Stefan Erb", 123)) +newId = persist("​T_USERS_INFO",​ array("​user name", "​system-id"​),​ array("​Stefan Erb", 123)) 
-'​Datensatz anpassen +'​Datensatz anpassen, das Geburtsdatum ergänzen 
-persist "​t_users_info",​ array("​id",​ "​birthday"​),​ array(1,  #6-1-1972#)+persist "​t_users_info",​ array("​id",​ "​birthday"​),​ array(newId,  #6-1-1972#)
 </​code>​ </​code>​
  
Line 160: Line 160:
 '​Anstelle von ""​ im String kann auch ' verwendet werden '​Anstelle von ""​ im String kann auch ' verwendet werden
 Dim newId As Long Dim newId As Long
-newId = persist "​T_USERS_INFO",​ "[user name]=""​Stefan Erb"",​ [system-id] = 123"+newId = (persist "​T_USERS_INFO",​ "[user name]=""​Stefan Erb"",​ [system-id] = 123")
 '​Datensatz anpassen '​Datensatz anpassen
-persist "​t_users_info",​ "id=1, birthday =  #​6-1-1972#"​+persist "​t_users_info",​ "id=" & newId & ", birthday =  #​6-1-1972#"​
 </​code>​ </​code>​
  
vba/access/functions/persist.1412866091.txt.gz · Last modified: 09.10.2014 16:48:11 by yaslaw