=================
Define a sql connectivity function:
def connection
#connection details like dsn, uid and password
$dsn = "POS"
$uid = ""
$pwd = ""
$c = ODBC.connect($dsn, $uid, $pwd)
end
def callConnection()
#opening database connection
connection()
end
#Typical login script
def onLoginClick(event)
$username="myUserName"
$password="myPassword"
$sql="select * from loginmaster where username='" + $username + "' and password='" + $password + "'"
#creating a connection object
$dsn = "POS"
$uid = ""
$pwd = ""
$c = ODBC.connect($dsn, $uid, $pwd)
$q=$c.prepare($sql)
$q.execute
if $q.fetch == nil then
#message will only show if you use wxpos - uncomment below if you are using wxwidget
# message_box("Incorrect Login", "Login",OK ICON_INFORMATION, self)
else
close()
end
end
Please Add Bookmark:
Connotea del.icio.us Digg it Furl Google ma.gnolia Netscape
Netvouz RawSugar reddit Shadows Simpy Spurl StumbleUpon Yahoo MyWeb
Connotea del.icio.us Digg it Furl Google ma.gnolia Netscape
Netvouz RawSugar reddit Shadows Simpy Spurl StumbleUpon Yahoo MyWeb
No comments:
Post a Comment