Log in |
Adding datetime data to an ODBC SQL backend via XMLRPCIntroductionThis how to illustrates how to add datetime data to an ODBC-based database via xmlrpc. Step 1: Create a database connectionCreate a database connection called connODBC to your database. Let us assume that you have a table called tblUser with the fields UserID (Text), LastLoginTime (DateTime). Step 2: Create an INSERT queryCreate a SQL query to insert data into the database called sqlAddRow with the following:
INSERT INTO tblUser ( UserID, LastLoginTime )
VALUES (
<dtml-var UserID>,
{ts <dtml-var LastLoginTime fmt=ISO>})
Step 3: Set permissions so that our basic xmlrpc client can access the object. Set the permissions so that Anonymous can View the sqlAddRow object. Step 4: Call the function from an xmlrpc client in Python.From C:\Program Files\Website\Lib\Python directory, type:
C:\Program Files\Website\Lib\Python>C:\Progra~1\Website\Bin\Python.exe
Python 1.5.2
>>>from xmlrpclib import Server, DateTime
>>>s=Server("http://localhost")
>>>dict={}
>>>dict['UserID']= |