- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi Bruce,
I have two quick questions about this tutorial if you have a chance to placate my inquiry.
When executing an SQL query such as: "SELECT UserID FROM FormsData WHERE UserID = 'DDuck'" in a cloned node works fine if I have bound a field <TextField1> to the data connection I am using. Makes sense. You reopen the connection, the data connection re-queries the DB and the form remerges the data into the bound (from $record.dataconnectionname.User) object.
A problem I am having is if DDuck isn't a user in the DB. The query seems to break, the code quits, and I don't get any errors. In SQL, if you were to query the above I might get a return of something like this:
I was hoping for a null or something I could test against.
The query is executed but returns no records(if the searched for UserID is not present). Programatically I can't seem to get past a return like this to evaluate if the data is present or not with Javascript. There likely is a better SQL statement for the query being presented here which makes this use case not happen, but I can't think of it with my limited SQL skills. I tried opening the DB with a try/catch statement to see if I could get an error, but I seem to get nothing still. Do you have any insight on what might be going on?
The second one is quicker I think. Executing the DB connection with the string above from the cloned node with the following command:
var dUser = "'DDuck'"
oDB.resolveNode("#command").query.select = "SELECT UserID FROM FormsData WHERE UserID = + dUser" <just an example>
How do I get the return value into a variable. Does it simply enter into oDB.rawValue? I don't think it's that simple right? I think I am a bit frazzled on the subject and could use a pointer.
Thank you for your time.
Alex
Views
Replies
Total Likes