[REBOL] Re: And another stumper....
From: kpeters:otaksoft at: 30-Aug-2007 12:20
... or so I thought - same error with revised code (my old code commented out)
Please bear with me one more time...
Thanks
Kai
;--------------------------------------------------------------------------------------------------
mysql-query: function [ {Either returns [["ERROR"]], [["EMPTY"]] or [[<cursor>]}
querystr [string!] statusbar [object! none!]] [ cursor ] [
print "about to open port"
if error? set/any 'mysql-error try [ mysqlport: open mysql-url cursor: send-sql mysqlport
querystr close mysqlport ][
disarm mysql-error
if statusbar <> none [ stat-upd statusbar reform [ "MySQL-Connection error: " mysql-error/arg1
]] return [["ERROR"]]
]
either cursor = [] [ return [[ "EMPTY" ]] ] [ return cursor ]
]
; mysql-error: try [
; mysqlport: open mysql-url
; cursor: send-sql mysqlport querystr
; close mysqlport
; ]
; either error? mysql-error [
; mysql-error: disarm mysql-error
; if statusbar <> none [ stat-upd sbar reform [ "MySQL-Connection error: " mysql-error/arg1
]]
; return [["ERROR"]]
; ][ either cursor = [] [ return [[ "EMPTY" ]] ] [ return cursor ]]
;]
about to open port
** Access Error: Cannot connect to 192.168.1.220
** Where: open-proto
** Near: mysqlport: open mysql-url cursor: send-sql